more leaks plumbed, added more debug-logging
authorStefan Kost <ensonic@users.sourceforge.net>
Tue, 20 Sep 2005 10:41:03 +0000 (10:41 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Tue, 20 Sep 2005 10:41:03 +0000 (10:41 +0000)
Original commit message from CVS:
* check/gst-libs/controller.c: (plugin_init), (GST_START_TEST):
* libs/gst/controller/gstcontroller.c: (gst_controller_new_valist):
more leaks plumbed, added more debug-logging
* gst/gstmacros.h:
whitespace fix

ChangeLog
check/gst-libs/controller.c
gst/gstmacros.h
libs/gst/controller/gstcontroller.c
tests/check/libs/controller.c

index f304c90..05687ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-20  Stefan Kost  <ensonic@users.sf.net>
+
+       * check/gst-libs/controller.c: (plugin_init), (GST_START_TEST):
+       * libs/gst/controller/gstcontroller.c: (gst_controller_new_valist):
+          more leaks plumbed, added more debug-logging
+       * gst/gstmacros.h:
+          whitespace fix
+
 2005-09-20  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * gst/gstmessage.c:
index 74591c8..066f0b7 100644 (file)
@@ -339,6 +339,7 @@ GST_START_TEST (controller_new_okay1)
   ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
   fail_unless (ctrl != NULL, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
@@ -357,6 +358,7 @@ GST_START_TEST (controller_new_okay2)
   ctrl = gst_controller_new (G_OBJECT (elem), "ulong", "double", NULL);
   fail_unless (ctrl != NULL, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
@@ -380,7 +382,7 @@ GST_START_TEST (controller_new_okay3)
   fail_unless (ctrl2 != NULL, NULL);
   fail_unless (ctrl1 == ctrl2, NULL);
 
-  g_object_unref (ctrl2);
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl1)->ref_count);
   g_object_unref (ctrl1);
   gst_object_unref (elem);
 }
@@ -408,6 +410,7 @@ GST_START_TEST (controller_param_twice)
   res = gst_controller_remove_properties (ctrl, "ulong", NULL);
   fail_unless (!res, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
@@ -472,6 +475,7 @@ GST_START_TEST (controller_interpolate_none)
   gst_controller_sink_values (ctrl, 2 * GST_SECOND);
   fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
index c347fc1..337f1ab 100644 (file)
@@ -29,7 +29,7 @@ G_BEGIN_DECLS
 
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
 # define GST_GNUC_CONSTRUCTOR \
-  __attribute__ ((constructor))  
+  __attribute__ ((constructor))
 #else  /* !__GNUC__ */
 # define GST_GNUC_CONSTRUCTOR
 #endif /* !__GNUC__ */
index 0dd3eb4..800a06e 100644 (file)
@@ -435,8 +435,9 @@ gst_controller_new_valist (GObject * object, va_list var_args)
           // store the controller
           g_object_set_qdata (object, controller_key, self);
         } else {
-          // increment ref-count
-          self = g_object_ref (self);
+          // increment ref-count (this causes red-count-leaks
+          //self = g_object_ref (self);
+          GST_INFO ("returning existing controller");
         }
         self->properties = g_list_prepend (self->properties, prop);
       }
@@ -446,6 +447,8 @@ gst_controller_new_valist (GObject * object, va_list var_args)
   }
   va_end (var_args);
 
+  if (self)
+    GST_INFO ("controller->ref_count=%d", G_OBJECT (self)->ref_count);
   return (self);
 }
 
index 74591c8..066f0b7 100644 (file)
@@ -339,6 +339,7 @@ GST_START_TEST (controller_new_okay1)
   ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
   fail_unless (ctrl != NULL, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
@@ -357,6 +358,7 @@ GST_START_TEST (controller_new_okay2)
   ctrl = gst_controller_new (G_OBJECT (elem), "ulong", "double", NULL);
   fail_unless (ctrl != NULL, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
@@ -380,7 +382,7 @@ GST_START_TEST (controller_new_okay3)
   fail_unless (ctrl2 != NULL, NULL);
   fail_unless (ctrl1 == ctrl2, NULL);
 
-  g_object_unref (ctrl2);
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl1)->ref_count);
   g_object_unref (ctrl1);
   gst_object_unref (elem);
 }
@@ -408,6 +410,7 @@ GST_START_TEST (controller_param_twice)
   res = gst_controller_remove_properties (ctrl, "ulong", NULL);
   fail_unless (!res, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }
@@ -472,6 +475,7 @@ GST_START_TEST (controller_interpolate_none)
   gst_controller_sink_values (ctrl, 2 * GST_SECOND);
   fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
 
+  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
   g_object_unref (ctrl);
   gst_object_unref (elem);
 }