CocoaPlugin: remove autoreleasepool warnings on 10.6

All examples running on 10.6 complained about missing autoreleasepools. This
patch adds them in where they were missing.

Change-Id: I18a1ddf486efdd1ece82d82d111b46e2ef064ff1
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
bb10
Richard Moe Gustavsen 2012-09-04 14:15:20 +02:00 committed by Qt by Nokia
parent 0c0c04b405
commit 7fd0c52da7
2 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,7 @@ QCocoaIntegration::QCocoaIntegration()
QCocoaIntegration::~QCocoaIntegration()
{
QCocoaAutoReleasePool pool;
if (!QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) {
// remove the apple event handlers installed by QCocoaApplicationDelegate
QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) *delegate = [QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate];

View File

@ -211,6 +211,7 @@ QCocoaWindow::~QCocoaWindow()
qDebug() << "QCocoaWindow::~QCocoaWindow" << this;
#endif
QCocoaAutoReleasePool pool;
clearNSWindow(m_nsWindow);
[m_contentView release];
[m_nsWindow release];
@ -229,6 +230,7 @@ void QCocoaWindow::setGeometry(const QRect &rect)
void QCocoaWindow::setCocoaGeometry(const QRect &rect)
{
QCocoaAutoReleasePool pool;
if (m_nsWindow) {
NSRect bounds = qt_mac_flipRect(rect, window());
[m_nsWindow setContentSize : bounds.size];