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; {------------------------------------------------------------------------------