From 99ad9fedf5cc24524e53bef73eff48f92bd24b57 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 10 Aug 2015 17:35:41 +0200 Subject: [PATCH] platform: delay destruction of NMPlatform singleton until NMConfig gets destroyed We want to create the platform instance rather late (especially after claiming the D-Bus service). But we also want to destroy it very late, because NMPlatform does not make use of any other singletons, but other singletons make use of NMPlatform. --- src/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 6a6b9f5417..6c3e70b865 100644 --- a/src/main.c +++ b/src/main.c @@ -420,11 +420,7 @@ main (int argc, char *argv[]) /* Set up platform interaction layer */ nm_linux_platform_setup (); - /* FIXME: intentionally leak the singleton instance of NMPlatform. - * nm_linux_platform_setup() will register the singleton for destruction, - * but we don't yet shut down all singletons properly, so don't destroy - * NMPlatform. */ - g_object_ref (NM_PLATFORM_GET); + NM_UTILS_KEEP_ALIVE (config, NM_PLATFORM_GET, "NMConfig-depends-on-NMPlatform"); nm_dispatcher_init ();