Fix memory leak in iOS viewer.

Forgot to add code to drain the Autorelease pool, so objects created
with autorelease just built up over time.

Bug: skia:8243
Change-Id: I373c6820df8ee102b110386377378858c235b2fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252601
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2019-11-04 15:02:00 -05:00 committed by Skia Commit-Bot
parent e94cdd2dbc
commit 923dad7a47

View File

@ -48,6 +48,9 @@ using sk_app::Application;
++i;
}
argv[i] = NULL;
[arguments release];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Application* app = Application::Create(argc, argv, nullptr);
@ -73,6 +76,9 @@ using sk_app::Application;
result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, kSeconds, TRUE);
} while (result == kCFRunLoopRunHandledSource);
[pool drain];
pool = [[NSAutoreleasePool alloc] init];
// TODO: is this the right approach for iOS?
// Rather than depending on an iOS event to drive this, we treat our window
// invalidation flag as a separate event stream. Window::onPaint() will clear