@@ -39,7 +39,9 @@ FlutterHostWindowController::~FlutterHostWindowController() {
39
39
std::optional<WindowMetadata> FlutterHostWindowController::CreateHostWindow (
40
40
WindowCreationSettings const & settings) {
41
41
auto window = std::make_unique<FlutterHostWindow>(this , settings);
42
+
42
43
if (!window->GetWindowHandle ()) {
44
+ FML_LOG (ERROR) << " Failed to create host window" ;
43
45
return std::nullopt;
44
46
}
45
47
@@ -66,6 +68,7 @@ bool FlutterHostWindowController::ModifyHostWindow(
66
68
WindowModificationSettings const & settings) const {
67
69
FlutterHostWindow* const window = GetHostWindow (view_id);
68
70
if (!window) {
71
+ FML_LOG (ERROR) << " Failed to find window with view ID " << view_id;
69
72
return false ;
70
73
}
71
74
@@ -96,13 +99,16 @@ bool FlutterHostWindowController::ModifyHostWindow(
96
99
97
100
bool FlutterHostWindowController::DestroyHostWindow (
98
101
FlutterViewId view_id) const {
99
- if (FlutterHostWindow* const window = GetHostWindow (view_id)) {
100
- // |window| will be removed from |windows_| when WM_NCDESTROY is handled.
101
- PostMessage (window->GetWindowHandle (), WM_CLOSE, 0 , 0 );
102
-
103
- return true ;
102
+ FlutterHostWindow* const window = GetHostWindow (view_id);
103
+ if (!window) {
104
+ FML_LOG (ERROR) << " Failed to find window with view ID " << view_id;
105
+ return false ;
104
106
}
105
- return false ;
107
+
108
+ // |window| will be removed from |windows_| when WM_NCDESTROY is handled.
109
+ PostMessage (window->GetWindowHandle (), WM_CLOSE, 0 , 0 );
110
+
111
+ return true ;
106
112
}
107
113
108
114
FlutterHostWindow* FlutterHostWindowController::GetHostWindow (
0 commit comments