Author Topic: Unloading TODO plugin makes the UI visible at a strange place  (Read 6751 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
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)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Unloading TODO plugin makes the UI visible at a strange place
« Reply #1 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Unloading TODO plugin makes the UI visible at a strange place
« Reply #2 on: May 01, 2012, 04:15:38 am »
Testing passed all listed steps (using Windows XP).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Unloading TODO plugin makes the UI visible at a strange place
« Reply #3 on: May 19, 2012, 12:34:44 am »
In svn...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]