frei0r: Correctly clean up elements to be reusable and not leak memory

This commit is contained in:
Sebastian Dröge 2009-06-29 12:02:19 +02:00
parent 72fca8a828
commit 0647d963ef
3 changed files with 15 additions and 0 deletions

View file

@ -59,6 +59,8 @@ gst_frei0r_filter_stop (GstBaseTransform * trans)
self->f0r_instance = NULL;
}
self->width = self->height = 0;
return TRUE;
}

View file

@ -45,8 +45,16 @@ gst_frei0r_mixer_reset (GstFrei0rMixer * self)
self->f0r_instance = NULL;
}
if (self->property_cache)
gst_frei0r_property_cache_free (klass->properties, self->property_cache,
klass->n_properties);
self->property_cache = NULL;
gst_caps_replace (&self->caps, NULL);
gst_event_replace (&self->newseg_event, NULL);
self->fmt = GST_VIDEO_FORMAT_UNKNOWN;
self->width = self->height = 0;
}
static void

View file

@ -146,6 +146,11 @@ gst_frei0r_src_stop (GstBaseSrc * basesrc)
self->f0r_instance = NULL;
}
self->fmt = GST_VIDEO_FORMAT_UNKNOWN;
self->width = self->height = 0;
self->fps_n = self->fps_d = 0;
self->n_frames = 0;
return TRUE;
}