summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-02-10 06:56:54 -0600
committerDan Williams <dcbw@redhat.com>2014-03-03 09:32:40 -0600
commitfe6b86a0789551e364908bf21e205c21b75dc0a1 (patch)
treee7c934a5aadc307f0ab393b1df94fd6aad861e68 /src/main.c
parent550ce1e631494126f2c8010030b661435e3744fc (diff)
downloadNetworkManager-fe6b86a0789551e364908bf21e205c21b75dc0a1.tar.gz
core: don't ref the Manager singleton
The OLPC mesh code did rely on nm_manager_get() referencing the singleton when returning it, but all other callers of nm_manager_get() did not. Thus the manager's refcount would always increase and almost never decrease. Fix the refcounting so that the manager always has only one ref, and it's lifetime is controlled by main() and nothing else.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index a25432feef..16a124c14f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -66,7 +66,6 @@
/*
* Globals
*/
-static NMManager *manager = NULL;
static GMainLoop *main_loop = NULL;
static gboolean quit_early = FALSE;
static sigset_t signal_set;
@@ -312,6 +311,7 @@ main (int argc, char *argv[])
gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE, wimax_enabled = TRUE;
gboolean success, show_version = FALSE;
int i;
+ NMManager *manager = NULL;
gs_unref_object NMVPNManager *vpn_manager = NULL;
gs_unref_object NMDnsManager *dns_mgr = NULL;
gs_unref_object NMDBusManager *dbus_mgr = NULL;