diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-13 18:00:46 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-13 18:00:46 -0700 |
commit | db9fb97ea824bea576222b51a841a6814a9c00d1 (patch) | |
tree | c41cb962ac281dd96de91b4128ed841d8adbbfd4 | |
parent | 009a28943c510b0de93b903ca191e586d08cd2e9 (diff) | |
download | qtlocation-mapboxgl-db9fb97ea824bea576222b51a841a6814a9c00d1.tar.gz |
[test] Fix use of uninitialized `dimensions` value (#4697)
Instead of calling resize, which would compare against the uninitialized dimensions values, initialize dimensions and needsResize directly.
-rw-r--r-- | platform/default/headless_view.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 9465f8ba9b..a764eb2e06 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -7,16 +7,20 @@ namespace mbgl { HeadlessView::HeadlessView(float pixelRatio_, uint16_t width, uint16_t height) - : display(std::make_shared<HeadlessDisplay>()), pixelRatio(pixelRatio_) { - resize(width, height); + : display(std::make_shared<HeadlessDisplay>()) + , pixelRatio(pixelRatio_) + , dimensions({{ width, height }}) + , needsResize(true) { } HeadlessView::HeadlessView(std::shared_ptr<HeadlessDisplay> display_, float pixelRatio_, uint16_t width, uint16_t height) - : display(std::move(display_)), pixelRatio(pixelRatio_) { - resize(width, height); + : display(std::move(display_)) + , pixelRatio(pixelRatio_) + , dimensions({{ width, height }}) + , needsResize(true) { } HeadlessView::~HeadlessView() { |