[gnote] Prevent a crash in the destruction chain NoteWindow (Closes #586084)



commit 94c002abf2f127e72fd47341ed72e5ef3750188e
Author: Hubert Figuiere <hub figuiere net>
Date:   Tue Jun 30 17:20:02 2009 -0400

    Prevent a crash in the destruction chain NoteWindow (Closes #586084)

 src/notewindow.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 2159618..0f5efa0 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -197,6 +197,8 @@ namespace gnote {
     m_global_keys = NULL;
     delete m_mark_set_timeout;
     m_mark_set_timeout = NULL;
+    // make sure editor is NULL. See bug 586084
+    m_editor = NULL;
     Preferences::obj().remove_notify(m_gconf_notify);
   }
 
@@ -560,7 +562,9 @@ namespace gnote {
   {
     // Reposition the current focus back to the editor so the
     // cursor will be ready for typing.
-    m_editor->grab_focus();
+    if(m_editor) {
+      m_editor->grab_focus();
+    }
   }
 
   //



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