CodeList crash when code completion is working

CodeLite installation/troubleshooting forum
Peter.Jiang
CodeLite Enthusiast
Posts: 13
Joined: Tue Oct 20, 2015 11:38 am
Genuine User: Yes
IDE Question: C++
Contact:

CodeList crash when code completion is working

Post by Peter.Jiang »

Win32 MingW32 CodeLite9.1.2
1. Open CodeLite, create any project;
2. editor the project, input something like #incoude <std
3. then the wxCodeCompletionBox comes out
4. keep this wxCodeCompletionBox showing, and just select other program(process) in windows, say, Chrome
5. turn back to the CodeLite, it crash

///////////the crash call stack////////////////////////
0 0xfeeefeee ??
1 0x078eb1fe wxWindow::MSWWindowProc E:\\work\\CodeLite\\wxWidgets-3.0.2-Debug\\src\\msw\\window.cpp 3651
2 0x078e90e0 wxWndProc E:\\work\\CodeLite\\wxWidgets-3.0.2-Debug\\src\\msw\\window.cpp 2711
3 0x764886ef USER32!IsThreadDesktopComposited
4 0x001e120c ??
5 0x0000001c ??
6 0x00000000 ??
Last edited by Peter.Jiang on Tue Aug 30, 2016 12:17 pm, edited 1 time in total.
Peter.Jiang
CodeLite Enthusiast
Posts: 13
Joined: Tue Oct 20, 2015 11:38 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeList crash when code completion is working

Post by Peter.Jiang »

if anyone knows any info about this problem, it will be very welcome to contact me by comment on this page or send me an email with address : long_jiang@c-sky.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeList crash when code completion is working

Post by eranif »

Its a bug in wxWidgets.
Just build CodeLite in release mode (mainly: build wxWidgets in Release mode)

Eran
Make sure you have read the HOW TO POST thread
Peter.Jiang
CodeLite Enthusiast
Posts: 13
Joined: Tue Oct 20, 2015 11:38 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeList crash when code completion is working

Post by Peter.Jiang »

Hi, Eran
I just change a little in our CodeLite's source code, in wxCodeCompletionBoxManager#DestroyCCBox():
////////////////////////////////////////////////////////////////
if(m_box) {
if(m_box->IsShown()) {
m_box->Hide();
}
m_box->Destroy(); // /////----> change this to " m_box->Close() "
}
m_box = NULL;
m_stc = NULL;
////////////////////////////////////////////////////////////////
This crash disappear, I have no idea about the effect by this change.
What do you think about this "patch" ?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeList crash when code completion is working

Post by eranif »

Does it create a memory leak?
I am not sure if "Close" calls "Destroy" eventually...

Eran
Make sure you have read the HOW TO POST thread
Peter.Jiang
CodeLite Enthusiast
Posts: 13
Joined: Tue Oct 20, 2015 11:38 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeList crash when code completion is working

Post by Peter.Jiang »

Hi, Eranif
I debugged this Close interface, it seems not do the real destroy work, thus, Close may cause memory leak.
I found another way to fix this problem:
in CodeLite's source code wxCodeCompletionBoxManager.cpp
///////////////////begin////////////////////////////////////////////
void wxCodeCompletionBoxManager::OnAppActivate(wxActivateEvent& event)
{
event.Skip();
DestroyCCBox(); // --> change this line into "CallAfter(&wxCodeCompletionBox::DoDestroy);"
}
///////////////////end/////////////////////////////////////////////
then, the crash disappear, and seems it will do the real destroy work;
how about this updating for the "patch" ?
Peter.Jiang
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeList crash when code completion is working

Post by eranif »

Looks good to me.
Committed
Make sure you have read the HOW TO POST thread
Post Reply