summaryrefslogtreecommitdiffstats
path: root/src/kernel/qeventloop_x11_glib.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-22 21:25:32 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-22 21:25:32 -0500
commit83d39cad274f592a43a3262926d215493caea0bc (patch)
tree05fefa97bd40200c6b7a1a184cd4df2610cc1091 /src/kernel/qeventloop_x11_glib.cpp
parent7abfc2a181531c769d50bcb1c0bff1fc08c66de2 (diff)
downloadqt3-83d39cad274f592a43a3262926d215493caea0bc.tar.gz
qt3-83d39cad274f592a43a3262926d215493caea0bc.zip
Fix a number of threading problems and crashes
This partially resolves Bug 1467
Diffstat (limited to 'src/kernel/qeventloop_x11_glib.cpp')
-rw-r--r--src/kernel/qeventloop_x11_glib.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/kernel/qeventloop_x11_glib.cpp b/src/kernel/qeventloop_x11_glib.cpp
index d37fbee..5226aa9 100644
--- a/src/kernel/qeventloop_x11_glib.cpp
+++ b/src/kernel/qeventloop_x11_glib.cpp
@@ -484,8 +484,9 @@ bool QEventLoop::gsourceCheck(GSource *gs) {
//if ( list ) {
QSockNotGPollFD *sn = list->first();
while ( sn ) {
- if ( sn->gPollFD.revents )
+ if ( sn->gPollFD.revents ) {
return TRUE;
+ }
sn = list->next();
}
//}
@@ -513,7 +514,7 @@ bool QEventLoop::gsourceCheck(GSource *gs) {
}
// check if we have timers to activate?
- timeval * tm =qt_wait_timer();
+ timeval * tm = qt_wait_timer();
if (tm && (tm->tv_sec == 0 && tm->tv_usec == 0 )) {
#ifdef DEBUG_QT_GLIBMAINLOOP
printf("inside gsourceCheck(2) qtwaittimer!\n");
@@ -582,14 +583,18 @@ bool QEventLoop::gsourceDispatch(GSource *gs) {
sn = list->next();
}
// }
-
- nevents += activateSocketNotifiers();
+
+ if (QApplication::isGuiThread()) {
+ nevents += activateSocketNotifiers();
+ }
}
// activate timers
if ( ! ( flags & 0x08 ) ) {
// 0x08 == ExcludeTimers for X11 only
- nevents += activateTimers();
+ if (QApplication::isGuiThread()) {
+ nevents += activateTimers();
+ }
}
// return true if we handled events, false otherwise