glimagesink: Guard against disconnecting invalid signal ids

This commit is contained in:
Sebastian Dröge 2015-04-06 20:24:06 -07:00
parent 4d790dae67
commit a72e204eae

View file

@ -1580,8 +1580,12 @@ gst_glimage_sink_on_close (GstGLImageSink * gl_sink)
window = gst_gl_context_get_window (gl_sink->context); window = gst_gl_context_get_window (gl_sink->context);
g_signal_handler_disconnect (window, gl_sink->key_sig_id); if (gl_sink->key_sig_id)
g_signal_handler_disconnect (window, gl_sink->mouse_sig_id); g_signal_handler_disconnect (window, gl_sink->key_sig_id);
gl_sink->key_sig_id = 0;
if (gl_sink->mouse_sig_id)
g_signal_handler_disconnect (window, gl_sink->mouse_sig_id);
gl_sink->mouse_sig_id = 0;
g_atomic_int_set (&gl_sink->to_quit, 1); g_atomic_int_set (&gl_sink->to_quit, 1);