Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: oBFusCATed on April 29, 2012, 03:25:20 pm

Title: Unloading TODO plugin makes the UI visible at a strange place
Post by: oBFusCATed on April 29, 2012, 03:25:20 pm
Hi,

I found a bug in the TODO plugin.
The problem is that if the plugin is unloaded from Plugins->Manage... the UI from the plugin is shown on top of the manager pane.
I have this little patch, which fixes the problem, but looking at the svn blame for the commented line I can see that it was commented because of a crash.
Can you test this patch end to report if this is still the case.
I've done all my testing on linux, so I don't know what is the state on windows.
Killerbot any thoughts?
Code
Index: src/plugins/todo/todolist.cpp
===================================================================
--- src/plugins/todo/todolist.cpp       (revision 7948)
+++ src/plugins/todo/todolist.cpp       (working copy)
@@ -136,7 +136,8 @@
         CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
         evt.pWindow = m_pListLog->GetWindow();
         Manager::Get()->ProcessEvent(evt);
-//        delete m_pListLog;
+        m_pListLog->GetWindow()->Destroy();
+        delete m_pListLog;
     }
     else
     {
@@ -144,7 +145,7 @@
 //        evt.window = m_pListLog->GetWindow();
         Manager::Get()->ProcessEvent(evt);
     }
-    m_pListLog = 0;
+    m_pListLog = nullptr;
 }
 
 void ToDoList::BuildMenu(wxMenuBar* menuBar)
Title: Re: Unloading TODO plugin makes the UI visible at a strange place
Post by: oBFusCATed on April 30, 2012, 08:29:14 pm
Seems this crash is similar to this one: http://forums.codeblocks.org/index.php/topic,16270.0.html

And the fix seems the same: http://cmpt.benbmp.org/codeblocks/patches/todo_load_unload.patch
Can anyone do some testing on windows of this patch?

Steps:
1. Load C::B
2. Plugins->Manage..
3. Load-unload the todo many times
4. Enable/disable Settings -> Environement -> Todo -> Include Todo window in massage pane
5. Repeat 3
6. Do some closing of C::B
Title: Re: Unloading TODO plugin makes the UI visible at a strange place
Post by: Alpha on May 01, 2012, 04:15:38 am
Testing passed all listed steps (using Windows XP).
Title: Re: Unloading TODO plugin makes the UI visible at a strange place
Post by: oBFusCATed on May 19, 2012, 12:34:44 am
In svn...