Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2018-10-02 13:30:56 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2018-10-08 14:51:03 +0300
commitd02ece7c63a1a189dbd3eaad310c30d7b7ac2cdf (patch)
tree900c44df8fcdfd40c9f75728eb32cca89a970644 /editor
parent4092d7641d8e6be15d95ace3568fe78e1e57f9a1 (diff)
Fixed crash on edits uploading
Diffstat (limited to 'editor')
-rw-r--r--editor/osm_editor.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/editor/osm_editor.cpp b/editor/osm_editor.cpp
index 47432e52ea..be1eb92d2a 100644
--- a/editor/osm_editor.cpp
+++ b/editor/osm_editor.cpp
@@ -843,10 +843,18 @@ void Editor::UploadChanges(string const & key, string const & secret, ChangesetT
{"mwm_version", strings::to_string(fti.m_feature.GetID().GetMwmVersion())}},
alohalytics::Location::FromLatLon(ll.lat, ll.lon));
}
- GetPlatform().RunTask(Platform::Thread::Gui, [this, id = fti.m_feature.GetID(), uploadInfo]()
+
+ // TODO (@milchakov): We can't call RunTask on Platform::Thread::Gui from async(launch::async, ...),
+ // since the thread must be attached to JVM to post tasks on gui thread.
+ // Now here is a workaround to prevent crash, but we have to consider the possibility to get rid of
+ // async(launch::async, ...) here.
+ GetPlatform().RunTask(Platform::Thread::Network, [this, id = fti.m_feature.GetID(), uploadInfo]()
{
- // Call Save every time we modify each feature's information.
- SaveUploadedInformation(id, uploadInfo);
+ GetPlatform().RunTask(Platform::Thread::Gui, [this, id, uploadInfo]()
+ {
+ // Call Save every time we modify each feature's information.
+ SaveUploadedInformation(id, uploadInfo);
+ });
});
}
}