summaryrefslogtreecommitdiff
path: root/library/MacPool.mm
diff options
context:
space:
mode:
authorTimothy Collett2012-05-26 16:08:15 -0400
committerTimothy Collett2012-05-26 16:08:15 -0400
commit7ec0fd6fc02815d6093cdff97599226045657053 (patch)
treeab6a3a147fcd6212f1c8720d3b285fe0bf2a332a /library/MacPool.mm
parent1dd4cc56670819e72d05c306d4f97d9b5a15cd3b (diff)
downloaddfhack-7ec0fd6fc02815d6093cdff97599226045657053.tar.gz
dfhack-7ec0fd6fc02815d6093cdff97599226045657053.tar.bz2
dfhack-7ec0fd6fc02815d6093cdff97599226045657053.tar.xz
Trying to set up an autorelease pool, but not yet succeeding.
Diffstat (limited to 'library/MacPool.mm')
-rw-r--r--library/MacPool.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/library/MacPool.mm b/library/MacPool.mm
new file mode 100644
index 00000000..2453aca2
--- /dev/null
+++ b/library/MacPool.mm
@@ -0,0 +1,22 @@
+/*
+ * MacPool.m
+ *
+ */
+
+#import <Foundation/Foundation.h>
+#import "MacPool.h"
+
+NSAutoreleasePool *thePool;
+
+int create_pool() {
+ fprintf(stderr,"Creating autorelease pool\n");
+ thePool = [[NSAutoreleasePool alloc] init];
+ return 1;
+}
+
+int destroy_pool() {
+ fprintf(stderr,"Draining and releasing autorelease pool\n");
+ [thePool drain];
+ [thePool release];
+ return 0;
+} \ No newline at end of file