Commits

Ivan Vučica committed b72d114

Added some atexit() cleanup.

Comments (0)

Files changed (1)

 #import "FPEventLoop.h"
 #import "FPWindowManager.h"
 
+static FPWindowManager * wm = nil;
+
+void cleanup()
+{
+	[wm release];
+}
+
 int main(int argc, char **argv)
 {
 	NSAutoreleasePool * pool = [NSAutoreleasePool new];
 
+	atexit(cleanup);
+
 	NSLog(@"FIREPLACE - Starting");
 	FPWindowManager * t = [FPWindowManager new];
 	if(!t)
 		return 1;
 	}
 
+	wm = t;
+
 	[[FPEventLoop mainLoop] run];
 	[[FPEventLoop mainLoop] release];
+
+	[wm release]; wm = nil;
 	[pool release];
 	return 0;
 }