summaryrefslogtreecommitdiff
path: root/macosx
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2014-02-19 14:51:46 -0800
committerJustin R. Miller <incanus@codesorcery.net>2014-02-19 17:51:30 -0800
commit9fbe5b2ece81c646f1f3d60f1d280a9241ba8937 (patch)
tree61ffb8877a5f82b9640dd81cce597d78915b2001 /macosx
parent0f2beb6992942feb2e22bf5476cf35b25eabd863 (diff)
downloadqtlocation-mapboxgl-9fbe5b2ece81c646f1f3d60f1d280a9241ba8937.tar.gz
properly deregister render observers
Diffstat (limited to 'macosx')
-rw-r--r--macosx/main.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/macosx/main.mm b/macosx/main.mm
index c4f3c87a57..7c2f0cc1ec 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -56,7 +56,7 @@ public:
glfwSetCharCallback(window, character);
glfwSetKeyCallback(window, key);
- [[NSNotificationCenter defaultCenter] addObserverForName:MBXNeedsRenderNotification
+ renderObserver = [[NSNotificationCenter defaultCenter] addObserverForName:MBXNeedsRenderNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock: ^ (NSNotification * notification) {
@@ -198,6 +198,7 @@ public:
}
~MapView() {
+ [[NSNotificationCenter defaultCenter] removeObserver:renderObserver];
glfwTerminate();
}
@@ -214,6 +215,8 @@ public:
GLFWwindow *window;
llmr::Settings_MacOSX settings;
llmr::Map map;
+
+ id renderObserver;
};
MapView *mapView;