From 4c204a4f3eb70e79e3a348b6347bc9686ab9f25e Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 20 Mar 2014 14:32:26 +0800 Subject: [PATCH] clutter-event-win32.c: Avoid a Crash Commit e70a0109 simplified the dispatching of events by passing the event's owernership to ClutterStage, but it may be so that any.stage is NULL at some point on Windows, which will either cause _clutter_stage_queue_event() to crash or issue a critical warning. Avoid this problem by checking whether event->any.stage is not NULL before trying to call _clutter_stage_queue_event(). https://bugzilla.gnome.org/show_bug.cgi?id=726765 --- clutter/win32/clutter-event-win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clutter/win32/clutter-event-win32.c b/clutter/win32/clutter-event-win32.c index 524dce0ed..7a360c625 100644 --- a/clutter/win32/clutter-event-win32.c +++ b/clutter/win32/clutter-event-win32.c @@ -294,7 +294,8 @@ clutter_event_dispatch (GSource *source, if ((event = clutter_event_get ())) { /* forward the event into clutter for emission etc. */ - _clutter_stage_queue_event (event->any.stage, event, FALSE); + if (event->any.stage) + _clutter_stage_queue_event (event->any.stage, event, FALSE); } _clutter_threads_release_lock ();