glimagesink: Only finalize the other context in finalize()

Otherwise we change a value of a property when going to READY state,
which is unexpected behaviour.
This commit is contained in:
Sebastian Dröge 2014-10-13 13:28:57 +02:00
parent dbdeed9b15
commit 302034ac4c

View file

@ -417,6 +417,11 @@ gst_glimage_sink_finalize (GObject * object)
g_mutex_clear (&glimage_sink->drawing_lock);
if (glimage_sink->other_context) {
gst_object_unref (glimage_sink->other_context);
glimage_sink->other_context = NULL;
}
g_free (glimage_sink->display_name);
GST_DEBUG ("finalized");
@ -588,11 +593,6 @@ gst_glimage_sink_stop (GstBaseSink * bsink)
glimage_sink->pool = NULL;
}
if (glimage_sink->other_context) {
gst_object_unref (glimage_sink->other_context);
glimage_sink->other_context = NULL;
}
return TRUE;
}
@ -684,11 +684,6 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
glimage_sink->context = NULL;
}
if (glimage_sink->other_context) {
gst_object_unref (glimage_sink->other_context);
glimage_sink->other_context = NULL;
}
if (glimage_sink->display) {
gst_object_unref (glimage_sink->display);
glimage_sink->display = NULL;