diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-02-20 14:59:17 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-02-20 19:26:06 +0100 |
commit | 3ef9e26593bfda1f32bc15d29016d9bb83acb67c (patch) | |
tree | d153624f97f189527af040f10594f3326e3a1e22 /platform/macos/src | |
parent | 4e752f63b94b71d901a1933a1bb121332fffe96b (diff) | |
download | qtlocation-mapboxgl-3ef9e26593bfda1f32bc15d29016d9bb83acb67c.tar.gz |
[ios,macos,android,qt] use shared threadpool
Diffstat (limited to 'platform/macos/src')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 7776e54183..7709632d13 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -11,6 +11,7 @@ #import "MGLMultiPoint_Private.h" #import "MGLOfflineStorage_Private.h" #import "MGLStyle_Private.h" +#import "MGLFoundation_Private.h" #import "MGLAccountManager.h" #import "MGLMapCamera.h" @@ -35,6 +36,7 @@ #import <mbgl/util/constants.hpp> #import <mbgl/util/chrono.hpp> #import <mbgl/util/run_loop.hpp> +#import <mbgl/util/shared_thread_pool.hpp> #import <map> #import <unordered_map> @@ -146,7 +148,7 @@ public: /// Cross-platform map view controller. mbgl::Map *_mbglMap; MGLMapViewImpl *_mbglView; - mbgl::ThreadPool *_mbglThreadPool; + std::shared_ptr<mbgl::ThreadPool> _mbglThreadPool; NSPanGestureRecognizer *_panGestureRecognizer; NSMagnificationGestureRecognizer *_magnificationGestureRecognizer; @@ -260,7 +262,7 @@ public: mbgl::DefaultFileSource* mbglFileSource = [MGLOfflineStorage sharedOfflineStorage].mbglFileSource; - _mbglThreadPool = new mbgl::ThreadPool(4); + _mbglThreadPool = mbgl::sharedThreadPool(); _mbglMap = new mbgl::Map(*_mbglView, self.size, [NSScreen mainScreen].backingScaleFactor, *mbglFileSource, *_mbglThreadPool, mbgl::MapMode::Continuous, mbgl::GLContextMode::Unique, mbgl::ConstrainMode::None, mbgl::ViewportMode::Default); [self validateTileCacheSize]; @@ -515,10 +517,6 @@ public: delete _mbglView; _mbglView = nullptr; } - if (_mbglThreadPool) { - delete _mbglThreadPool; - _mbglThreadPool = nullptr; - } } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(__unused NSDictionary *)change context:(void *)context { |