summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Tarasov <igor.tarasov@mapbox.com>2019-09-20 17:19:54 +0300
committerIgor Tarasov <igor.tarasov@mapbox.com>2019-09-20 17:19:54 +0300
commit2b251cf9eaa2ce3e9b62b9eeccef291433a6a3f5 (patch)
tree0b5a49ac2e60ae74583a27181b756095c56c5bf2
parent18b4aa0bea64e3314241c986b1c540e6f7afe7f3 (diff)
downloadqtlocation-mapboxgl-2b251cf9eaa2ce3e9b62b9eeccef291433a6a3f5.tar.gz
[android] Style sources - revert back to use strong ref.
Still having null pointer deref crash in FinalizerDeamon, something wrong with "peer release".
-rw-r--r--platform/android/src/style/sources/source.cpp2
-rw-r--r--platform/android/src/style/sources/source.hpp1
2 files changed, 1 insertions, 2 deletions
diff --git a/platform/android/src/style/sources/source.cpp b/platform/android/src/style/sources/source.cpp
index dcbcc483e8..c067c5d1c4 100644
--- a/platform/android/src/style/sources/source.cpp
+++ b/platform/android/src/style/sources/source.cpp
@@ -100,7 +100,7 @@ namespace android {
// Save reference before transferring ownership
nonOwnedSource_ = ownedSource_->makeWeakPtr();
// Add peer to core source
- ownedSource_->peer = weakFactory_.makeWeakPtr();
+ ownedSource_->peer = std::unique_ptr<Source>(this);
// Add source to map and release ownership
map.getStyle().addSource(std::move(ownedSource_));
diff --git a/platform/android/src/style/sources/source.hpp b/platform/android/src/style/sources/source.hpp
index 4107464b8c..880128d965 100644
--- a/platform/android/src/style/sources/source.hpp
+++ b/platform/android/src/style/sources/source.hpp
@@ -82,7 +82,6 @@ protected:
private:
std::unique_ptr<mbgl::style::Source> ownedSource_ { nullptr };
mapbox::base::WeakPtr<mbgl::style::Source> nonOwnedSource_;
- mapbox::base::WeakPtrFactory<Source> weakFactory_ {this};
};
} // namespace android