[gnote] Fix possible crash when deleting a notebook



commit 843855885fcc8eddccbfa74ee97115c559794fef
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jul 9 21:18:45 2017 +0300

    Fix possible crash when deleting a notebook
    
    Fixes Bug 701846

 src/notebooks/notebookmanager.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/notebooks/notebookmanager.cpp b/src/notebooks/notebookmanager.cpp
index b9264ac..d796fe2 100644
--- a/src/notebooks/notebookmanager.cpp
+++ b/src/notebooks/notebookmanager.cpp
@@ -184,10 +184,10 @@ namespace gnote {
         }
         
         Gtk::TreeIter iter = map_iter->second;;
+        // first remove notebook from map, then from store, because the later cases a UI refresh, that can 
query back here
+        m_notebookMap.erase(map_iter);
         m_notebooks->erase (iter);
-        
-        m_notebookMap.erase (map_iter);
-        
+
         // Remove the notebook tag from every note that's in the notebook
         std::list<NoteBase*> notes;
         Tag::Ptr tag = notebook->get_tag();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]