Fix hand/crash in pause when rotating screen

This commit is contained in:
Leith Bade
2014-11-19 20:13:37 +11:00
parent e52cf05ac3
commit 69d42411ab
2 changed files with 7 additions and 8 deletions

View File

@@ -541,20 +541,18 @@ void NativeMapView::loadExtensions() {
void NativeMapView::stop() {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::stop");
assert(display != EGL_NO_DISPLAY);
assert(context != EGL_NO_CONTEXT);
map.stop();
if ((display != EGL_NO_DISPLAY) && (display != EGL_NO_CONTEXT)) {
map.stop();
}
}
void NativeMapView::pause(bool wait_for_pause) {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause %s", (wait_for_pause) ? "true" : "false");
assert(display != EGL_NO_DISPLAY);
assert(context != EGL_NO_CONTEXT);
map.pause(wait_for_pause);
if ((display != EGL_NO_DISPLAY) && (display != EGL_NO_CONTEXT)) {
map.pause(wait_for_pause);
}
}
void NativeMapView::resume() {

View File

@@ -429,6 +429,7 @@ void Map::setStyleJSON(std::string newStyleJSON, const std::string &base) {
if (!style) {
style = std::make_shared<Style>();
}
style->loadJSON((const uint8_t *)styleJSON.c_str());
if (!fileSource) {
fileSource = std::make_shared<FileSource>(**loop, platform::defaultCacheDatabase());