From 53066a6564ce331940217e809d34cf6eba13d780 Mon Sep 17 00:00:00 2001 From: zeljko Date: Sat, 20 Oct 2007 12:12:46 +0000 Subject: [PATCH] Qt: Fixed AppWaitMessage(), produced AV's sometimes because of pending events. git-svn-id: trunk@12533 - --- lcl/interfaces/qt/qtobject.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt/qtobject.inc b/lcl/interfaces/qt/qtobject.inc index 21bb32ac00..644aae3de6 100644 --- a/lcl/interfaces/qt/qtobject.inc +++ b/lcl/interfaces/qt/qtobject.inc @@ -138,7 +138,11 @@ end; ------------------------------------------------------------------------------} procedure TQtWidgetSet.AppWaitMessage; begin - QCoreApplication_processEvents(QEventLoopWaitForMoreEvents); + {we cannot call directly processEvents() with this flag + since it produces AV's sometimes, so better check is there + any pending event.} + if not QCoreApplication_hasPendingEvents then + QCoreApplication_processEvents(QEventLoopWaitForMoreEvents); end; {------------------------------------------------------------------------------