diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-04-28 16:28:01 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-05-12 10:19:15 +0300 |
commit | 6e58ba0abc25d4737036c3efe8ac80ee74ea5c4b (patch) | |
tree | 1c56b5d7cf55594720b027cbb8cdd58b19ff5559 /indexer/osm_editor.cpp | |
parent | 8ac15533c0d5a518e27b9f2f652ef2cefc7bc1ac (diff) |
Make editor a field of Framework.
Diffstat (limited to 'indexer/osm_editor.cpp')
-rw-r--r-- | indexer/osm_editor.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index 868a108f90..141f455ef6 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -137,10 +137,16 @@ namespace osm // (e.g. insert/remove spaces after ';' delimeter); Editor::Editor() : m_notes(editor::Notes::MakeNotes()) {} + Editor & Editor::Instance() { - static Editor instance; - return instance; + ASSERT(s_instance, ("nullptr dereference.")); + return *s_instance; +} + +void Editor::SetInstance(Editor * editor) +{ + s_instance = editor; } void Editor::LoadMapEdits() @@ -968,4 +974,6 @@ string DebugPrint(Editor::FeatureStatus fs) } const char * const Editor::kPlaceDoesNotExistMessage = "The place has gone or never existed. This is an auto-generated note from MAPS.ME application: a user reports a POI that is visible on a map (which can be outdated), but cannot be found on the ground."; + +Editor * Editor::s_instance = nullptr; } // namespace osm |