diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-05-18 17:44:59 +0200 |
---|---|---|
committer | ian29 <ian.villeda@gmail.com> | 2018-05-19 14:51:17 -0400 |
commit | dd2e15367f32f938be3c230f5471e35ddde8b492 (patch) | |
tree | b71b852e776da42c4572c75a767e333d7f4f3c3e /platform/node | |
parent | d64d265a1fc79e0ed4d38ff6135709bd4ace3fe1 (diff) | |
download | qtlocation-mapboxgl-dd2e15367f32f938be3c230f5471e35ddde8b492.tar.gz |
[node] prevent race condition for renderFinished
Diffstat (limited to 'platform/node')
-rw-r--r-- | platform/node/src/node_map.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index 9b76f0f542..521cca1a51 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -447,6 +447,12 @@ void NodeMap::startRender(NodeMap::RenderOptions options) { } void NodeMap::renderFinished() { + if (!callback) { + // In some situations, the render finishes at the same time as we call cancel. Make sure + // we are only finishing a render once. + return; + } + Nan::HandleScope scope; // We're done with this render call, so we're unrefing so that the loop could close. |