1/*
2 * Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15#include "cocoainitializer.h"
16
17#import <Foundation/NSAutoreleasePool.h>
18#import <AppKit/NSApplication.h>
19
20namespace OCC {
21namespace Mac {
22
23class CocoaInitializer::Private {
24  public:
25    NSAutoreleasePool* autoReleasePool;
26};
27
28CocoaInitializer::CocoaInitializer() {
29  d = new CocoaInitializer::Private();
30  NSApplicationLoad();
31  d->autoReleasePool = [[NSAutoreleasePool alloc] init];
32}
33
34CocoaInitializer::~CocoaInitializer() {
35  [d->autoReleasePool release];
36  delete d;
37}
38
39} // namespace Mac
40} // namespace OCC
41