Author Topic: Crash when the EditorTweaks plugins is unloaded  (Read 3260 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Crash when the EditorTweaks plugins is unloaded
« on: August 22, 2010, 12:44:10 am »
Hello,

My CB started to crash when I've disabled the EditorTweaks plugins.
The crash happens when I right click in the editor.

And here is the fix:

Code
Index: src/sdk/pluginmanager.cpp
===================================================================
--- src/sdk/pluginmanager.cpp   (revision 6508)
+++ src/sdk/pluginmanager.cpp   (working copy)
@@ -1399,7 +1399,7 @@
     for (unsigned int i = 0; i < m_Plugins.GetCount(); ++i)
     {
         cbPlugin* plug = m_Plugins[i]->plugin;
-        if (plug)
+        if (plug && plug->IsAttached())
         {
             try
             {

Tested on trunk @ head, gentoo linux 64bit
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Crash when the EditorTweaks plugins is unloaded
« Reply #1 on: August 22, 2010, 02:16:38 pm »
And here is the fix:
Good catch! Applied.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ