Go to file
Jonathan Hoffmann 5cc76dae7e BlackBerry: improve BPS event lifetime management
In QEventDispatcherBlackberry::select(), if an event handler called
through filterEvent() starts a nested event loop by creating a new
QEventLoop, we will recursively enter the select() method again.
However, each time bps_get_event() is called, it destroys the last
event it handed out before returning the next event.  We don't want it
to destroy the event that triggered the nested event loop, since there
may still be more handlers that need to get that event, once the
nested event loop is done and control returns to the outer event loop.

So we move an event to a holding channel, which takes ownership of the
event.  Putting the event on our own channel allows us to manage when
it is destroyed, keeping it alive until we know we are done with it.
Each recursive call of this function needs to have it's own holding
channel, since a channel is a queue, not a stack.

However, a recursive call into the select() method happens very rarely
compared to the many times this method is called.  We don't want to
create a holding channel for each time this method is called, only
when it is called recursively.  Thus we have the instance variable
d->holding_channel to use in the common case.  We keep track of
recursive calls with d->loop_level.  If we are in a recursive call,
then we create a new holding channel for this run.

Change-Id: Ib3584676d2db5a9a3754a1535d5fb6c9e14f5dbb
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2013-10-23 19:09:54 +02:00
bin Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-06-15 22:39:25 +02:00
config.tests Detect pointer size at configure-time on Windows-hosted builds 2013-10-22 12:15:57 +02:00
dist changelog: add note about TLS session tickets 2013-10-21 13:38:00 +02:00
doc Doc: Remove Plug & Paint plugins from the list of examples 2013-10-09 11:01:35 +02:00
examples don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
lib
mkspecs Rename BlackBerry arm mkspecs to be aligned with NDK structure 2013-10-23 19:09:54 +02:00
qmake Skip extra PKGCONFIG variables with empty value 2013-10-22 00:22:17 +02:00
src BlackBerry: improve BPS event lifetime management 2013-10-23 19:09:54 +02:00
tests QFileDialog can delete files too, not just directories 2013-10-23 19:09:54 +02:00
tools Detect pointer size at configure-time on Windows-hosted builds 2013-10-22 12:15:57 +02:00
util QTimeZone - Define new class and api 2013-09-22 22:21:15 +02:00
.gitattributes
.gitignore Long live QCommandLineParser! 2013-08-24 21:33:39 +02:00
.qmake.conf Enable -Werror for all of qtbase 2013-09-04 01:50:10 +02:00
.tag
configure more escaping of slashes in awk regexp 2013-10-18 18:01:54 +02:00
configure.bat get rid of syncqt wrapper scripts 2013-05-13 21:54:48 +02:00
header.BSD Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.FDL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.LGPL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.LGPL-ONLY Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
INSTALL INSTALL: Fix URL of Installing Qt documentation 2013-04-11 16:09:07 +02:00
LGPL_EXCEPTION.txt Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
LICENSE.FDL
LICENSE.GPL
LICENSE.LGPL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
LICENSE.PREVIEW.COMMERCIAL Update LICENSE.PREVIEW.COMMERCIAL license 2013-06-03 20:04:26 +02:00
qtbase.pro Merge remote-tracking branch 'origin/stable' into dev 2013-06-27 13:06:38 +02:00
sync.profile put ANGLE includes in a QtANGLE subdir 2013-06-10 21:12:13 +02:00