From 68292b05d9b89ed59b6bf9fc2e6e6a7a0f24efdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 19 Jun 2018 13:07:34 +0200
Subject: [PATCH] phosh: assign singleton in main

This makes it more obvious where it comes from
---
 src/phosh.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/phosh.c b/src/phosh.c
index 7ffddb9..9e14c2b 100644
--- a/src/phosh.c
+++ b/src/phosh.c
@@ -732,8 +732,6 @@ phosh_shell_constructed (GObject *object)
   PhoshShellPrivate *priv = phosh_shell_get_instance_private (self);
   guint num_mon;;
 
-  _phosh = self; /* set singleton */
-
   G_OBJECT_CLASS (phosh_shell_parent_class)->constructed (object);
 
   gdk_set_allowed_backends ("wayland");
@@ -922,7 +920,7 @@ int main(int argc, char *argv[])
   g_source_set_callback (sigterm, sigterm_cb, NULL, NULL);
   g_source_attach (sigterm, context);
 
-  g_object_new (PHOSH_TYPE_SHELL, NULL);
+  _phosh = g_object_new (PHOSH_TYPE_SHELL, NULL);
   gtk_main ();
   g_object_unref (_phosh);
   _phosh = NULL;
-- 
GitLab