From 0293aff5c44202e5c62e229b74d8bd0bf9206185 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Fri, 11 Sep 2009 12:49:25 +0200 Subject: Fix memory leak when deleteLater is triggered via the main menu bar. The deleteLater was beeing created with loopLevel of 1, causing it to be defferd until QApplication::exec() returned. Add a QScopedLoopLevelCounter to increase the loopLevel while triggering the action. RevBy: Brad --- src/gui/kernel/qcocoamenuloader_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index ce2a92c..9ab077f 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -198,6 +199,7 @@ QT_USE_NAMESPACE - (IBAction)qtDispatcherToQAction:(id)sender { + QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData); NSMenuItem *item = static_cast(sender); if (QAction *action = reinterpret_cast([item tag])) { action->trigger(); -- cgit v0.12