From 6149e30699b36901715d46a5cef8959625ef399b Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Tue, 18 May 2021 05:55:51 +0100 Subject: Trigger demo quit from applicationWillTerminate Allows for a clean shutdown of the rendering thread (CVDisplayLink) whilst the main thread is exiting --- cube/macOS/cubepp/DemoViewController.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cube/macOS/cubepp/DemoViewController.mm') diff --git a/cube/macOS/cubepp/DemoViewController.mm b/cube/macOS/cubepp/DemoViewController.mm index 9e003b9b..7bc4681f 100644 --- a/cube/macOS/cubepp/DemoViewController.mm +++ b/cube/macOS/cubepp/DemoViewController.mm @@ -33,11 +33,15 @@ } - (void)dealloc { - demo.cleanup(); - CVDisplayLinkRelease(_displayLink); + [self quit]; [super dealloc]; } +- (void)quit { + CVDisplayLinkRelease(_displayLink); + demo.cleanup(); +} + /** Since this is a single-view app, initialize Vulkan during view loading. */ - (void)viewDidLoad { [super viewDidLoad]; -- cgit v1.2.3