Blame SOURCES/qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck.patch

2060a3
diff -ur qt-everywhere-opensource-src-4.6.3/src/gui/kernel/qguieventdispatcher_glib.cpp qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck/src/gui/kernel/qguieventdispatcher_glib.cpp
2060a3
--- qt-everywhere-opensource-src-4.6.3/src/gui/kernel/qguieventdispatcher_glib.cpp	2010-06-02 04:03:15.000000000 +0200
2060a3
+++ qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck/src/gui/kernel/qguieventdispatcher_glib.cpp	2010-12-08 22:22:38.000000000 +0100
2060a3
@@ -76,7 +76,7 @@
2060a3
     GX11EventSource *source = reinterpret_cast<GX11EventSource *>(s);
2060a3
     return (XEventsQueued(X11->display, QueuedAfterFlush)
2060a3
             || (!(source->flags & QEventLoop::ExcludeUserInputEvents)
2060a3
-                && !source->d->queuedUserInputEvents.isEmpty()));
2060a3
+                && source->d && !source->d->queuedUserInputEvents.isEmpty()));
2060a3
 }
2060a3
 
2060a3
 static gboolean x11EventSourceCheck(GSource *s)
2060a3
@@ -84,7 +84,7 @@
2060a3
     GX11EventSource *source = reinterpret_cast<GX11EventSource *>(s);
2060a3
     return (XEventsQueued(X11->display, QueuedAfterFlush)
2060a3
             || (!(source->flags & QEventLoop::ExcludeUserInputEvents)
2060a3
-                && !source->d->queuedUserInputEvents.isEmpty()));
2060a3
+                && source->d && !source->d->queuedUserInputEvents.isEmpty()));
2060a3
 }
2060a3
 
2060a3
 static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointer user_data)
2060a3
@@ -95,7 +95,7 @@
2060a3
     do {
2060a3
         XEvent event;
2060a3
         if (!(source->flags & QEventLoop::ExcludeUserInputEvents)
2060a3
-            && !source->d->queuedUserInputEvents.isEmpty()) {
2060a3
+            && source->d && !source->d->queuedUserInputEvents.isEmpty()) {
2060a3
             // process a pending user input event
2060a3
             event = source->d->queuedUserInputEvents.takeFirst();
2060a3
         } else if (XEventsQueued(X11->display, QueuedAlready)) {
2060a3
@@ -112,7 +112,8 @@
2060a3
                 case XKeyRelease:
2060a3
                 case EnterNotify:
2060a3
                 case LeaveNotify:
2060a3
-                    source->d->queuedUserInputEvents.append(event);
2060a3
+                    if (source->d)
2060a3
+                        source->d->queuedUserInputEvents.append(event);
2060a3
                     continue;
2060a3
 
2060a3
                 case ClientMessage:
2060a3
@@ -127,7 +128,8 @@
2060a3
                             break;
2060a3
                         }
2060a3
                     }
2060a3
-                    source->d->queuedUserInputEvents.append(event);
2060a3
+                    if (source->d)
2060a3
+                        source->d->queuedUserInputEvents.append(event);
2060a3
                     continue;
2060a3
 
2060a3
                 default:
2060a3
@@ -140,7 +142,7 @@
2060a3
         }
2060a3
 
2060a3
         // send through event filter
2060a3
-        if (source->q->filterEvent(&event))
2060a3
+        if (source->q && source->q->filterEvent(&event))
2060a3
             continue;
2060a3
 
2060a3
         if (qApp->x11ProcessEvent(&event) == 1)
2060a3
@@ -152,7 +154,8 @@
2060a3
 
2060a3
  out:
2060a3
 
2060a3
-    source->d->runTimersOnceWithNormalPriority();
2060a3
+    if (source->d)
2060a3
+        source->d->runTimersOnceWithNormalPriority();
2060a3
 
2060a3
     if (callback)
2060a3
         callback(user_data);