Differences From Artifact [e705f7e9ee]:
- File
src/OFApplication.m
— part of check-in
[e1e7ffa903]
at
2011-09-22 23:25:42
on branch trunk
— Exceptions are now autoreleased.
This is safe as an "exception loop" can't happen, since if allocating
an exception fails, it throws an OFAllocFailedException which is
preallocated and can always be thrown.So, the worst case would be that an autorelease of an exception fails,
triggering an OFOutOfMemoryException for which there is no memory,
resulting in an OFAllocFailedException to be thrown. (user: js, size: 5271) [annotate] [blame] [check-ins using]
To Artifact [741469d176]:
- File src/OFApplication.m — part of check-in [87cd99ff88] at 2011-10-24 18:28:28 on branch trunk — Don't retain delegates to prevent reference cycles. (user: js, size: 5171) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
38 39 40 41 42 43 44 | #endif static OFApplication *app = nil; static void atexit_handler(void) { | < < | < > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #endif static OFApplication *app = nil; static void atexit_handler(void) { [[app delegate] applicationWillTerminate]; } int of_application_main(int *argc, char **argv[], Class cls) { OFApplication *app = [OFApplication sharedApplication]; id <OFApplicationDelegate> delegate = [[cls alloc] init]; [app setArgumentCount: argc andArgumentValues: argv]; [app setDelegate: delegate]; [app run]; [(id)delegate release]; return 0; } @implementation OFApplication + sharedApplication { |
︙ | ︙ | |||
227 228 229 230 231 232 233 | - (OFDictionary*)environment { OF_GETTER(environment, YES) } - (id <OFApplicationDelegate>)delegate { | | | | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | - (OFDictionary*)environment { OF_GETTER(environment, YES) } - (id <OFApplicationDelegate>)delegate { return delegate; } - (void)setDelegate: (id <OFApplicationDelegate>)delegate_ { delegate = delegate_; } - (void)run { [delegate applicationDidFinishLaunching]; } |
︙ | ︙ | |||
254 255 256 257 258 259 260 | exit(status); } - (void)dealloc { [arguments release]; [environment release]; | < | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | exit(status); } - (void)dealloc { [arguments release]; [environment release]; [super dealloc]; } @end @implementation OFObject (OFApplicationDelegate) - (void)applicationDidFinishLaunching |
︙ | ︙ |