@@ -24,14 +24,17 @@ #import "OFApplication.h" #import "OFString.h" #import "OFArray.h" #import "OFDictionary.h" -#import "OFThread.h" +#ifdef OF_THREADS +# import "OFThread.h" +#endif #import "OFRunLoop.h" #import "autorelease.h" +#import "macros.h" #if defined(__MACH__) && !defined(OF_IOS) # include #elif defined(_WIN32) # include @@ -375,13 +378,18 @@ - (void)run { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop; +#ifdef OF_THREADS [OFThread OF_createMainThread]; runLoop = [OFRunLoop currentRunLoop]; - [OFRunLoop OF_setMainRunLoop]; +#else + runLoop = [[[OFRunLoop alloc] init] autorelease]; +#endif + + [OFRunLoop OF_setMainRunLoop: runLoop]; objc_autoreleasePoolPop(pool); pool = objc_autoreleasePoolPush(); [delegate applicationDidFinishLaunching];