From d9fa7a77f1016327e53877f6a65ec4122993445d Mon Sep 17 00:00:00 2001
From: Alexander Sack <asac@ubuntu.com>
Date: Thu, 15 Oct 2009 19:16:57 +0200
Subject: [PATCH] authority: g_object_ref authority when returning singleton

---
 src/polkit/polkitauthority.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
index 1f89dfd..39b98e9 100644
--- a/src/polkit/polkitauthority.c
+++ b/src/polkit/polkitauthority.c
@@ -253,8 +253,10 @@ polkit_authority_class_init (PolkitAuthorityClass *klass)
 PolkitAuthority *
 polkit_authority_get (void)
 {
-  if (the_authority != NULL)
+  if (the_authority != NULL) {
+    g_object_ref (the_authority);
     goto out;
+  }
 
   the_authority = POLKIT_AUTHORITY (g_object_new (POLKIT_TYPE_AUTHORITY, NULL));
 
-- 
1.6.3.3

