forked from qt-creator/qt-creator
OS X: Create a help AutoreleasePool class
That wraps NSAutoreleasePool and releases it at destruction. Change-Id: Ie7049450da46458f02c02d38439e20e43609ca83 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "openpagesmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/autoreleasepool.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QApplication>
|
||||
@@ -68,26 +69,7 @@
|
||||
#import <WebKit/WebUIDelegate.h>
|
||||
#import <WebKit/WebView.h>
|
||||
|
||||
// #pragma mark -- AutoreleasePool
|
||||
|
||||
class AutoreleasePool
|
||||
{
|
||||
public:
|
||||
AutoreleasePool();
|
||||
~AutoreleasePool();
|
||||
private:
|
||||
NSAutoreleasePool *pool;
|
||||
};
|
||||
|
||||
AutoreleasePool::AutoreleasePool()
|
||||
{
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
AutoreleasePool::~AutoreleasePool()
|
||||
{
|
||||
[pool release];
|
||||
}
|
||||
using namespace Utils;
|
||||
|
||||
// #pragma mark -- mac helpers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user