diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-07-13 12:09:22 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | b3e6d76a1729ead40eb1fa5af98d8d734dfdd09b (patch) | |
tree | 0504158947384de8e8cf751b31f4013cea074806 | |
parent | b166f3512f5e426e60a4ff610a9f07239ac18ea1 (diff) |
app: reset g_app on ~App()
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r-- | src/app.cpp | 4 | ||||
-rw-r--r-- | src/app.hpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/app.cpp b/src/app.cpp index b261c53..29b28b5 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -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; diff --git a/src/app.hpp b/src/app.hpp index 4e1c4ff..172e688 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -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(); |