[glx] Perform more checks before calling glXMakeCurrent
Right now we just check for a NULL stage before calling glXMakeCurrent(). We can, though, get a valid stage without an implementation attached to it while we are disposing a stage after a CLUTTER_DELETE event, since the events processing is performed on a vblank-locked basis.
This commit is contained in:
parent
93e1d8e7a3
commit
172074fd29
@ -409,7 +409,14 @@ static void
|
|||||||
clutter_backend_glx_ensure_context (ClutterBackend *backend,
|
clutter_backend_glx_ensure_context (ClutterBackend *backend,
|
||||||
ClutterStage *stage)
|
ClutterStage *stage)
|
||||||
{
|
{
|
||||||
if (stage == NULL)
|
ClutterStageWindow *impl;
|
||||||
|
|
||||||
|
/* if there is no stage, the stage is being destroyed or it has no
|
||||||
|
* implementation attached to it then we clear the GL context
|
||||||
|
*/
|
||||||
|
if (stage == NULL ||
|
||||||
|
(CLUTTER_PRIVATE_FLAGS (stage) & CLUTTER_ACTOR_IN_DESTRUCTION) ||
|
||||||
|
((impl = _clutter_stage_get_window (stage)) == NULL))
|
||||||
{
|
{
|
||||||
ClutterBackendX11 *backend_x11;
|
ClutterBackendX11 *backend_x11;
|
||||||
|
|
||||||
@ -423,9 +430,7 @@ clutter_backend_glx_ensure_context (ClutterBackend *backend,
|
|||||||
ClutterBackendGLX *backend_glx;
|
ClutterBackendGLX *backend_glx;
|
||||||
ClutterStageGLX *stage_glx;
|
ClutterStageGLX *stage_glx;
|
||||||
ClutterStageX11 *stage_x11;
|
ClutterStageX11 *stage_x11;
|
||||||
ClutterStageWindow *impl;
|
|
||||||
|
|
||||||
impl = _clutter_stage_get_window (stage);
|
|
||||||
g_assert (impl != NULL);
|
g_assert (impl != NULL);
|
||||||
|
|
||||||
CLUTTER_NOTE (MULTISTAGE, "Setting context for stage of type %s [%p]",
|
CLUTTER_NOTE (MULTISTAGE, "Setting context for stage of type %s [%p]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user