Sometimes I get a access violation after press enter in editor control.
I found following code sequence (a simple call stack):
wxwidgets/src/msw/window.cpp:
---
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
// If this has been processed by an event handler, return 0 now
// (we've handled it).
m_lastKeydownProcessed = HandleKeyDown((WORD) wParam, lParam);
---
sheet.cpp:
---
wxSheet::DisableCellEditControl
...
GetSheetRefData()->m_cellEditor.DestroyControl();
---
sheetedt.cpp:
---
wxSheetCellEditorRefData::DestroyControl
...
win->Destroy();
---
The line "win->Destroy" deletes editor object, but is called from "HandleKeyDown".
After "HandleKeyDown" returned, the heap object is destroyed and a assignment to member variable "m_lastKeydownProcessed" happens.
This assignment damages the heap.
my hotfix is:
replace line "win->Destroy();"
by
"wxTheApp->GetTraits()->ScheduleForDestroy(win);"