summaryrefslogtreecommitdiff
path: root/test/tile
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-05-13 16:37:40 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-05-14 11:29:24 +0300
commit5b6a262e1544fc9f649b53ef15ae19b9057356f1 (patch)
tree004cf1678190a8a75bb48e002da39575793f3023 /test/tile
parent7e77aff8dfc2434846614f919cd4f8db1a2ca2f0 (diff)
downloadqtlocation-mapboxgl-5b6a262e1544fc9f649b53ef15ae19b9057356f1.tar.gz
[core] GeometryTile and TileLoader keep strong reference to FileSource
Thus we fix a potential bug: if `Renderer` outlives the `Map` it will hold a stale reference to the `FileSource` instance.
Diffstat (limited to 'test/tile')
-rw-r--r--test/tile/custom_geometry_tile.test.cpp4
-rw-r--r--test/tile/geojson_tile.test.cpp4
-rw-r--r--test/tile/raster_dem_tile.test.cpp4
-rw-r--r--test/tile/raster_tile.test.cpp4
-rw-r--r--test/tile/vector_tile.test.cpp4
5 files changed, 10 insertions, 10 deletions
diff --git a/test/tile/custom_geometry_tile.test.cpp b/test/tile/custom_geometry_tile.test.cpp
index 39f6e33caf..1aed821cd6 100644
--- a/test/tile/custom_geometry_tile.test.cpp
+++ b/test/tile/custom_geometry_tile.test.cpp
@@ -22,10 +22,10 @@ using namespace mbgl::style;
class CustomTileTest {
public:
- FakeFileSource fileSource;
+ std::shared_ptr<FileSource> fileSource = std::make_shared<FakeFileSource>();
TransformState transformState;
util::RunLoop loop;
- style::Style style { fileSource, 1 };
+ style::Style style { *fileSource, 1 };
AnnotationManager annotationManager { style };
ImageManager imageManager;
GlyphManager glyphManager;
diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp
index 75e9ccbc7a..bf42278e4c 100644
--- a/test/tile/geojson_tile.test.cpp
+++ b/test/tile/geojson_tile.test.cpp
@@ -21,10 +21,10 @@ using namespace mbgl::style;
class GeoJSONTileTest {
public:
- FakeFileSource fileSource;
+ std::shared_ptr<FileSource> fileSource = std::make_shared<FakeFileSource>();
TransformState transformState;
util::RunLoop loop;
- style::Style style { fileSource, 1 };
+ style::Style style { *fileSource, 1 };
AnnotationManager annotationManager { style };
ImageManager imageManager;
GlyphManager glyphManager;
diff --git a/test/tile/raster_dem_tile.test.cpp b/test/tile/raster_dem_tile.test.cpp
index 8abd6efe12..42e7594720 100644
--- a/test/tile/raster_dem_tile.test.cpp
+++ b/test/tile/raster_dem_tile.test.cpp
@@ -16,10 +16,10 @@ using namespace mbgl;
class RasterDEMTileTest {
public:
- FakeFileSource fileSource;
+ std::shared_ptr<FileSource> fileSource = std::make_shared<FakeFileSource>();
TransformState transformState;
util::RunLoop loop;
- style::Style style { fileSource, 1 };
+ style::Style style { *fileSource, 1 };
AnnotationManager annotationManager { style };
ImageManager imageManager;
GlyphManager glyphManager;
diff --git a/test/tile/raster_tile.test.cpp b/test/tile/raster_tile.test.cpp
index 3437061fa5..f19bd26260 100644
--- a/test/tile/raster_tile.test.cpp
+++ b/test/tile/raster_tile.test.cpp
@@ -16,10 +16,10 @@ using namespace mbgl;
class RasterTileTest {
public:
- FakeFileSource fileSource;
+ std::shared_ptr<FileSource> fileSource = std::make_shared<FakeFileSource>();
TransformState transformState;
util::RunLoop loop;
- style::Style style { fileSource, 1 };
+ style::Style style { *fileSource, 1 };
AnnotationManager annotationManager { style };
ImageManager imageManager;
GlyphManager glyphManager;
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp
index 05c415fb22..b912af1f15 100644
--- a/test/tile/vector_tile.test.cpp
+++ b/test/tile/vector_tile.test.cpp
@@ -22,10 +22,10 @@ using namespace mbgl;
class VectorTileTest {
public:
- FakeFileSource fileSource;
+ std::shared_ptr<FileSource> fileSource = std::make_shared<FakeFileSource>();
TransformState transformState;
util::RunLoop loop;
- style::Style style { fileSource, 1 };
+ style::Style style { *fileSource, 1 };
AnnotationManager annotationManager { style };
ImageManager imageManager;
GlyphManager glyphManager;