App: remove unused g_app global, make dtor default
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Wed, 13 Sep 2017 14:47:56 +0000 (16:47 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Thu, 14 Sep 2017 12:04:51 +0000 (14:04 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/app.cpp
src/app.hpp

index 3ee4379..ac70489 100644 (file)
@@ -39,7 +39,6 @@
 namespace wm {
 
 namespace {
-App *g_app;
 
 using nlohmann::json;
 
@@ -84,9 +83,6 @@ App::App(wl::display *d)
      id_alloc{},
      pending_events(false),
      policy{} {
-   assert(g_app == nullptr);
-   g_app = this;
-
    try {
       {
          auto l = load_layer_map(
@@ -102,8 +98,6 @@ App::App(wl::display *d)
    }
 }
 
-App::~App() { g_app = nullptr; }
-
 int App::init() {
    if (!this->display->ok()) {
       return -1;
index aac28cd..9424d9f 100644 (file)
@@ -126,7 +126,7 @@ struct App {
    Policy policy;
 
    explicit App(wl::display *d);
-   ~App();
+   ~App() = default;
 
    App(App const &) = delete;
    App &operator=(App const &) = delete;