Ver código fonte

LibGUI: Add GUI::Application::in_teardown()

This will return true after ~GUI::Application() has been entered.
Andreas Kling 3 anos atrás
pai
commit
24ea6a8ce7

+ 8 - 0
Userland/Libraries/LibGUI/Application.cpp

@@ -101,8 +101,16 @@ Application::Application(int argc, char** argv, Core::EventLoop::MakeInspectable
     });
     });
 }
 }
 
 
+static bool s_in_teardown;
+
+bool Application::in_teardown()
+{
+    return s_in_teardown;
+}
+
 Application::~Application()
 Application::~Application()
 {
 {
+    s_in_teardown = true;
     revoke_weak_ptrs();
     revoke_weak_ptrs();
 }
 }
 
 

+ 2 - 0
Userland/Libraries/LibGUI/Application.h

@@ -27,6 +27,8 @@ public:
 
 
     ~Application();
     ~Application();
 
 
+    static bool in_teardown();
+
     int exec();
     int exec();
     void quit(int = 0);
     void quit(int = 0);