Signal-iOS/Signal/main.m
Michelle Linington 543902d034 Call UIApplicationMain() outside of autoreleasepool
Since UIApplicationMain() never returns, it'll prevent its containing
autoreleasepool from draining. This could in leaked objects that are
never released.

This isn't terribly necessary, since we don't have any leaked
autoreleased objects from our pre-UIAppMain setup. But if that ever
changes, this will prevent us from inadvertently leaking memory.
2021-04-08 13:35:17 -07:00

22 lines
614 B
Objective-C

//
// Copyright (c) 2021 Open Whisper Systems. All rights reserved.
//
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
NSString *appDelegateName;
@autoreleasepool {
// Any setup work pre-UIApplicationMain() should be placed
// inside this autoreleasepool.
appDelegateName = NSStringFromClass(AppDelegate.class);
}
// UIApplicationMain is intentionally called outside of the above
// autoreleasepool. The function never returns, so its parent
// autoreleasepool will never be drained.
return UIApplicationMain(argc, argv, nil, appDelegateName);
}