glcontext/eagl: handle sending one message during shutdown
authorMatthew Waters <matthew@centricular.com>
Fri, 29 May 2020 09:08:51 +0000 (19:08 +1000)
committerMatthew Waters <matthew@centricular.com>
Tue, 2 Jun 2020 04:32:03 +0000 (14:32 +1000)
commit51b057ea261715e27590eea74abc8ae664b46098
tree1952c070cf422cb0099e3ee7059df35e53d25315
parentc506adc95003c65be2fd84765e170e1ef76452a5
glcontext/eagl: handle sending one message during shutdown

gst_gl_window_quit() will attempt to send a message but will be called
from GstGLContext's finalize handler and so the weak ref that backs
gst_gl_window_get_context will return NULL as it has already been
cleared.  We need that context in send_message_async to decide whether
to run the provided callback immediately or queue in GCD

This is the equivalent commit for iOS as:
7f59cefafb1cd733cf527fb935b2cd32418fcbe2
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/618

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/681>
gst-libs/gst/gl/eagl/gstglwindow_eagl.m