diff options
author | Tim Blechmann <tim@klingt.org> | 2015-11-18 17:11:07 +0700 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-11-23 13:38:18 +0000 |
commit | 084df84bd096fe78eec5edd62424bd625dcfc00b (patch) | |
tree | 1a6f00c1a58fb7235a9cf598c5e917f11713f678 /src/plugins/platforms | |
parent | 07efdb78f03fb2f75898cc769b3224baee4d8d90 (diff) |
QPI/Cocoa: QNSView - guard removeFromSuperview by autorelease pool
removeFromSuperview could be called from outside the Qt domain (e.g from
a native cocoa gui). we need to guard it by an autorelease pool to make
sure that potential release/dealloc methods are not postponed to a point
when we do not have a qapplication anymore
Change-Id: If65cce4c524a16ffee125694c534f900c7d08fa8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index bad67f2516..50b456cab7 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -99,6 +99,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); - (void)textInputContextKeyboardSelectionDidChangeNotification : (NSNotification *) textInputContextKeyboardSelectionDidChangeNotification; - (void)viewDidHide; - (void)viewDidUnhide; +- (void)removeFromSuperview; - (BOOL)isFlipped; - (BOOL)acceptsFirstResponder; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index f414193bdb..3faa292ae0 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -498,6 +498,12 @@ QT_WARNING_POP m_platformWindow->exposeWindow(); } +- (void)removeFromSuperview +{ + QMacAutoReleasePool pool; + [super removeFromSuperview]; +} + - (void) flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset { m_backingStore = backingStore; |