diff options
author | Edward Hervey <bilboed@bilboed.com> | 2010-07-23 15:33:49 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2010-07-23 15:33:49 +0200 |
commit | 60b14e7002c0fcf1acd7ed4ef9aa4e714394209f (patch) | |
tree | aa0688ffaa31ef650b514e4bff6159c74a17dfbe | |
parent | ed14ebe5f622fbd9b669ef321ac1f987f2ae1a38 (diff) |
gnlcomposition: Use G_TYPE private instances
This ensures the private data is 'closer' to the public structures
-rw-r--r-- | gnl/gnlcomposition.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 286e3bf..b5a10ad 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -247,6 +247,8 @@ gnl_composition_class_init (GnlCompositionClass * klass) GST_DEBUG_CATEGORY_INIT (gnlcomposition, "gnlcomposition", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin Composition"); + g_type_class_add_private (klass, sizeof (GnlCompositionPrivate)); + gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_composition_dispose); gobject_class->finalize = GST_DEBUG_FUNCPTR (gnl_composition_finalize); gobject_class->set_property = @@ -310,7 +312,9 @@ gnl_composition_init (GnlComposition * comp, { GST_OBJECT_FLAG_SET (comp, GNL_OBJECT_SOURCE); - comp->priv = g_new0 (GnlCompositionPrivate, 1); + comp->priv = + G_TYPE_INSTANCE_GET_PRIVATE (comp, GNL_TYPE_COMPOSITION, + GnlCompositionPrivate); comp->priv->objects_lock = g_mutex_new (); comp->priv->objects_start = NULL; comp->priv->objects_stop = NULL; @@ -392,9 +396,6 @@ gnl_composition_finalize (GObject * object) g_mutex_free (comp->priv->flushing_lock); - - g_free (comp->priv); - G_OBJECT_CLASS (parent_class)->finalize (object); } |