Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Crash when unloading compiler plugin

<< < (2/4) > >>

Jenna:
For some obscure reasons parts of OnRelease will be run twice, if it is called the second time.
The crash happens in wxAuiNotebook::SetSelectionToWindow if m_pLog is deleted first, and in some sizer-releated code, if m_pListLog is deleted first. Butthe crash is just a symptom, there must be a real problem, probably in our code, or with the compiler.

The crash happens with wx2.8 and wx2.9, C::B is compiled with wx4.6 and pch's.
I try it with pch's disabled now.

Jenna:

--- Quote from: jens on April 30, 2012, 10:28:21 am ---I try it with pch's disabled now.

--- End quote ---
Exactly the same behaviour.

oBFusCATed:
Using this patch fixes the problem: http://cmpt.benbmp.org/codeblocks/patches/compiler_load_unload.patch

It seems that removing the event handler from the chain in the main window fixes it.
Also by reading the docs of wxEvtHandler, I've found this:

--- Quote ---When using multiple inheritance it is imperative that the wxEvtHandler(-derived) class be the first class inherited such that the "this" pointer for the overall object will be identical to the "this" pointer for the wxEvtHandler portion.

--- End quote ---
I'm not sure why this is the case, but I've modified the class to obey this rule. There are other cases which violate it, so they need to be fixed, too.
I guess probably they are casting a void pointer or something like that to wxEvtHandler in some of the macros and they rely on this hack.

Jenna:
Good catch !
Your patch works fine here, tested with wx2.9  on debian 64bit.

From my point of view, you should commit it, if it is does not break anything on windows.

MortenMacFly:

--- Quote from: jens on April 30, 2012, 09:27:06 pm ---From my point of view, you should commit it, if it is does not break anything on windows.

--- End quote ---
I'll try both patches (the other one of the ToDo list plugin) today on Windows. BTW: This is especially "critical" in wx29 as the event handler chain has caused a lot trouble there...I'll report back.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version