Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-07-13 02:14:48 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:40:57 +0300
commit132f07f8bef9ee51582c71f4d3fb079b5ebaddb2 (patch)
treed2a8e96fa83db46eb26c7bf429aa052bad9c5ca3 /platform
parent01857d535e997b23c901abfc1dbbf87e811b1e4f (diff)
[iOS] Fix some potential bug in WindowHandle <-> IOSVideoTimer routine.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios_video_timer.mm9
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/ios_video_timer.mm b/platform/ios_video_timer.mm
index 0f2eb42db9..061da11da4 100644
--- a/platform/ios_video_timer.mm
+++ b/platform/ios_video_timer.mm
@@ -48,10 +48,12 @@ public:
{
if (m_displayLink)
{
+ // Set EStopped flag first. It seems like 'CADisplayLink::invalidate' can invoke pending 'perform'.
+ // So we should check EStopped flag in 'perform' to skip pending call.
+ m_state = EStopped;
[m_displayLink invalidate];
[m_objCppWrapper release];
m_displayLink = 0;
- m_state = EStopped;
}
}
@@ -69,7 +71,10 @@ public:
void perform()
{
- m_frameFn();
+ // In case when we stopped and have pending perform at the same time.
+ // It's not allowed to call m_frameFn after stopping (see WindowHandle::~WindowHandle).
+ if (m_state != EStopped)
+ m_frameFn();
}
};