[farsight2/master] Use GInitiallyUnowned for fs-nice-thread

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:24 PST 2008


---
 transmitters/nice/fs-nice-stream-transmitter.c |    2 --
 transmitters/nice/fs-nice-thread.c             |    5 ++---
 transmitters/nice/fs-nice-thread.h             |    4 ++--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 8b5d720..78cec8a 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -964,8 +964,6 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
 
     g_object_set_data (G_OBJECT (thread), "nice-thread", thread);
 
-    g_object_unref (thread);
-
     if (self->priv->stun_ip && self->priv->stun_port)
       g_object_set (agent,
           "stun-server", self->priv->stun_ip,
diff --git a/transmitters/nice/fs-nice-thread.c b/transmitters/nice/fs-nice-thread.c
index 2f6b4a4..0866539 100644
--- a/transmitters/nice/fs-nice-thread.c
+++ b/transmitters/nice/fs-nice-thread.c
@@ -112,7 +112,7 @@ fs_nice_thread_register_type (FsPlugin *module)
   };
 
   type = g_type_module_register_type (G_TYPE_MODULE (module),
-      G_TYPE_OBJECT, "FsNiceThread", &info, 0);
+      G_TYPE_INITIALLY_UNOWNED, "FsNiceThread", &info, 0);
 
   return type;
 }
@@ -221,11 +221,10 @@ fs_nice_thread_add_weak_object (FsNiceThread *self,
 {
   g_object_weak_ref (G_OBJECT (object), (GWeakNotify) g_object_unref, self);
 
-  g_object_ref (self);
+  g_object_ref_sink (self);
 }
 
 
-
 static gpointer
 fs_nice_thread_main_thread (gpointer data)
 {
diff --git a/transmitters/nice/fs-nice-thread.h b/transmitters/nice/fs-nice-thread.h
index e858fb5..62f8697 100644
--- a/transmitters/nice/fs-nice-thread.h
+++ b/transmitters/nice/fs-nice-thread.h
@@ -62,7 +62,7 @@ typedef struct _FsNiceThreadPrivate FsNiceThreadPrivate;
 
 struct _FsNiceThreadClass
 {
-  GObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 };
 
 /**
@@ -72,7 +72,7 @@ struct _FsNiceThreadClass
  */
 struct _FsNiceThread
 {
-  GObject parent;
+  GInitiallyUnowned parent;
 
   /*< private >*/
   FsNiceThreadPrivate *priv;
-- 
1.5.6.5




More information about the farsight-commits mailing list