@@ -39,7 +39,9 @@ FlutterHostWindowController::~FlutterHostWindowController() {
3939std::optional<WindowMetadata> FlutterHostWindowController::CreateHostWindow (
4040 WindowCreationSettings const & settings) {
4141 auto window = std::make_unique<FlutterHostWindow>(this , settings);
42+
4243 if (!window->GetWindowHandle ()) {
44+ FML_LOG (ERROR) << " Failed to create host window" ;
4345 return std::nullopt ;
4446 }
4547
@@ -66,6 +68,7 @@ bool FlutterHostWindowController::ModifyHostWindow(
6668 WindowModificationSettings const & settings) const {
6769 FlutterHostWindow* const window = GetHostWindow (view_id);
6870 if (!window) {
71+ FML_LOG (ERROR) << " Failed to find window with view ID " << view_id;
6972 return false ;
7073 }
7174
@@ -96,13 +99,16 @@ bool FlutterHostWindowController::ModifyHostWindow(
9699
97100bool FlutterHostWindowController::DestroyHostWindow (
98101 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 ;
104106 }
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 ;
106112}
107113
108114FlutterHostWindow* FlutterHostWindowController::GetHostWindow (
0 commit comments