aboutsummaryrefslogtreecommitdiff
path: root/cube/macOS/cubepp/DemoViewController.mm
diff options
context:
space:
mode:
authorJake Turner <jake@evansturner.co.uk>2021-05-18 05:55:51 +0100
committerjeremyk-lunarg <jeremyk@lunarg.com>2021-05-31 09:17:55 -0600
commit6149e30699b36901715d46a5cef8959625ef399b (patch)
tree1f541c02df513c14c3a69efd7fd30b789a622d77 /cube/macOS/cubepp/DemoViewController.mm
parentdaa3490ea48a3f4a84f8e281c6e45bc7b06498c2 (diff)
downloadusermoji-6149e30699b36901715d46a5cef8959625ef399b.tar.xz
Trigger demo quit from applicationWillTerminate
Allows for a clean shutdown of the rendering thread (CVDisplayLink) whilst the main thread is exiting
Diffstat (limited to 'cube/macOS/cubepp/DemoViewController.mm')
-rw-r--r--cube/macOS/cubepp/DemoViewController.mm8
1 files changed, 6 insertions, 2 deletions
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];