ソースを参照

LibGUI: Don't ask WindowServer to destroy windows during app teardown

This makes teardown faster since we don't have to wait for responses to
each destroy_window request. It also avoids doing IPC during teardown,
which is a general source of problems.
Andreas Kling 3 年 前
コミット
60a245b065
1 ファイル変更6 行追加0 行削除
  1. 6 0
      Userland/Libraries/LibGUI/Window.cpp

+ 6 - 0
Userland/Libraries/LibGUI/Window.cpp

@@ -198,6 +198,12 @@ void Window::hide()
 {
 {
     if (!is_visible())
     if (!is_visible())
         return;
         return;
+
+    // NOTE: Don't bother asking WindowServer to destroy windows during application teardown.
+    //       All our windows will be automatically garbage-collected by WindowServer anyway.
+    if (GUI::Application::in_teardown())
+        return;
+
     auto destroyed_window_ids = WindowServerConnection::the().destroy_window(m_window_id);
     auto destroyed_window_ids = WindowServerConnection::the().destroy_window(m_window_id);
     server_did_destroy();
     server_did_destroy();