tee: Check for the removed pad flag also in the slow pushing path
[platform/upstream/gstreamer.git] / gst / gstminiobject.c
index 324346c..d5c28ba 100644 (file)
@@ -506,7 +506,12 @@ remove_notify (GstMiniObject * object, gint index)
 
   /* remove item */
   priv_data->n_qdata--;
-  if (index != priv_data->n_qdata) {
+  if (priv_data->n_qdata == 0) {
+    /* we don't shrink but free when everything is gone */
+    g_free (priv_data->qdata);
+    priv_data->qdata = NULL;
+    priv_data->n_qdata_len = 0;
+  } else if (index != priv_data->n_qdata) {
     QDATA (priv_data, index) = QDATA (priv_data, priv_data->n_qdata);
   }
 }
@@ -687,7 +692,7 @@ gst_mini_object_unref (GstMiniObject * mini_object)
  **/
 #undef gst_clear_mini_object
 void
-gst_clear_mini_object (volatile GstMiniObject ** object_ptr)
+gst_clear_mini_object (GstMiniObject ** object_ptr)
 {
   g_clear_pointer (object_ptr, gst_mini_object_unref);
 }