Move padtemplate clearing from class_init to base_init
authorDavid Schleef <ds@schleef.org>
Sat, 3 Jan 2004 01:25:01 +0000 (01:25 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 3 Jan 2004 01:25:01 +0000 (01:25 +0000)
Original commit message from CVS:
Move padtemplate clearing from class_init to base_init

ChangeLog
gst/gstelement.c

index f3e4e91..39bb952 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-01-02  David Schleef  <ds@schleef.org>
+
+       * gst/gstelement.c: (gst_element_class_init),
+       (gst_element_base_class_init): ->padtemplates should be cleared
+       in base_init, since we need to have a fresh list for every
+       class.  (Alternately, we chould copy the list and share the
+       actual pad templates (not the list), but that would require
+       changing every plugin to move pad template registration from
+       base_init to class_init.)
+
 2004-01-03  Ronald Bultje  <rbultje@ronald.bitfreak.net>
 
        * gst/gstelement.c: (gst_element_class_add_pad_template):
index ddfbffb..1abfc21 100644 (file)
@@ -154,7 +154,6 @@ gst_element_class_init (GstElementClass *klass)
   klass->change_state                  = GST_DEBUG_FUNCPTR (gst_element_change_state);
   klass->error                         = GST_DEBUG_FUNCPTR (gst_element_error_func);
   klass->found_tag                     = GST_DEBUG_FUNCPTR (gst_element_found_tag_func);
-  klass->padtemplates                  = NULL;
   klass->numpadtemplates               = 0;
 
   klass->elementfactory                        = NULL;
@@ -164,9 +163,13 @@ static void
 gst_element_base_class_init (gpointer g_class)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
+  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
 
   gobject_class->set_property =                GST_DEBUG_FUNCPTR(gst_element_real_set_property);
   gobject_class->get_property =                GST_DEBUG_FUNCPTR(gst_element_real_get_property);
+
+  element_class->padtemplates = NULL;
 }
 
 static void