QTfrontend/CocoaInitializer.mm
author unc0rr
Sun, 07 Nov 2010 17:01:48 +0300
changeset 4160 043c17a8b3ca
parent 3697 d5b30d6373fc
child 5095 15dd764b728c
permissions -rw-r--r--
Don't call getrandom() from parameters to a function. The order of calls is undefined, so desyncs are probable.

/*
 * Copyright (C) 2008 Remko Troncon
 */

#include "CocoaInitializer.h"

#include <AppKit/AppKit.h>
#include <Cocoa/Cocoa.h>
#include <QtDebug>

class CocoaInitializer::Private
{
	public:
		NSAutoreleasePool* autoReleasePool_;
};

CocoaInitializer::CocoaInitializer()
{
	d = new CocoaInitializer::Private();
        c = new CocoaInitializer::Private();
	NSApplicationLoad();
        c->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
	d->autoReleasePool_ = [[NSAutoreleasePool alloc] init];
}

CocoaInitializer::~CocoaInitializer()
{
	[d->autoReleasePool_ release];
        [c->autoReleasePool_ release];
	delete c;
	delete d;
}