Patch #2252 2007-11-21 00:14

pauliusz

Fix crash when removing file outside CB
Download
2252-Fix_crash_when.patch (790 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2007-11-21 04:32
Assigned to
biplab
Index: src/sdk/editorbase.cpp
===================================================================
--- src/sdk/editorbase.cpp    (revision 4650)
+++ src/sdk/editorbase.cpp    (working copy)
@@ -122,6 +122,11 @@
 
 EditorBase::~EditorBase()
 {
+    if (Manager::Get()->GetEditorManager()) // sanity check
+        Manager::Get()->GetEditorManager()->RemoveCustomEditor(this);
+
+    delete m_pData;
+
     if (Manager::Get()->GetPluginManager())
     {
         CodeBlocksEvent event(cbEVT_EDITOR_CLOSE);
@@ -130,11 +135,6 @@
 
         Manager::Get()->GetPluginManager()->NotifyPlugins(event);
     }
-
-    if (Manager::Get()->GetEditorManager()) // sanity check
-        Manager::Get()->GetEditorManager()->RemoveCustomEditor(this);
-
-    delete m_pData;
 }
 
 const wxString& EditorBase::GetTitle()
pauliusz 2007-11-21 00:15
biplab 2007-11-21 04:32

Thanks for the patch.