@@ -40,13 +40,11 @@ static OFApplication *app = nil; static void atexit_handler(void) { - id delegate = [app delegate]; - - [delegate applicationWillTerminate]; + [[app delegate] applicationWillTerminate]; } int of_application_main(int *argc, char **argv[], Class cls) { @@ -55,13 +53,14 @@ [app setArgumentCount: argc andArgumentValues: argv]; [app setDelegate: delegate]; - [(id)delegate release]; [app run]; + + [(id)delegate release]; return 0; } @implementation OFApplication @@ -229,16 +228,16 @@ OF_GETTER(environment, YES) } - (id )delegate { - OF_GETTER(delegate, YES) + return delegate; } - (void)setDelegate: (id )delegate_ { - OF_SETTER(delegate, delegate_, YES, NO) + delegate = delegate_; } - (void)run { [delegate applicationDidFinishLaunching]; @@ -256,11 +255,10 @@ - (void)dealloc { [arguments release]; [environment release]; - [(id)delegate release]; [super dealloc]; } @end