diff options
author | Mike Morris <michael.patrick.morris@gmail.com> | 2015-11-13 14:14:51 -0500 |
---|---|---|
committer | Mike Morris <michael.patrick.morris@gmail.com> | 2015-11-13 14:37:17 -0500 |
commit | a9f808d3dca33c3954b42a1b2a5a5984affa615b (patch) | |
tree | 36ed6f06237c9636b772bd1152bcdccd61a82626 | |
parent | 05932750da4db346728eec8c45edd5a4b1863d24 (diff) | |
download | qtlocation-mapboxgl-a9f808d3dca33c3954b42a1b2a5a5984affa615b.tar.gz |
[node] cancel all pending requests in NodeFileSource destructor
-rw-r--r-- | platform/node/src/node_file_source.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/node/src/node_file_source.cpp b/platform/node/src/node_file_source.cpp index eab664ebcf..029b8ab0f6 100644 --- a/platform/node/src/node_file_source.cpp +++ b/platform/node/src/node_file_source.cpp @@ -30,6 +30,12 @@ NodeFileSource::~NodeFileSource() { queue->stop(); queue = nullptr; + // Cancel all pending requests + for (const auto& it : pending) { + auto requestHandle = Nan::New(it.second); + Nan::ObjectWrap::Unwrap<NodeRequest>(requestHandle)->cancel(); + } + options.Reset(); } |