app: reset g_app on ~App()
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Thu, 13 Jul 2017 10:09:22 +0000 (12:09 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/app.cpp
src/app.hpp

index b261c53..29b28b5 100644 (file)
@@ -22,6 +22,10 @@ App::App(wl::display *d) : api{this}, display{d}, controller{}, outputs() {
    g_app = this;
 }
 
+App::~App() {
+   g_app = nullptr;
+}
+
 int App::init() {
    if (!this->display->ok()) {
       return -1;
index 4e1c4ff..172e688 100644 (file)
@@ -32,6 +32,10 @@ struct App {
    std::vector<std::unique_ptr<struct wl::output>> outputs;
 
    App(wl::display *d);
+   ~App();
+
+   App(App const &) = delete;
+   App &operator=(App const &) = delete;
 
    int init();
    int dispatch_events();