Bugs item #2504323, was opened at 2009-01-13 12:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=2504323&group_id=51305

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxsheet
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Thomas (thheidler)
Assigned to: John Labenski (jrl1)
Summary: access violation after press enter in editor control

Initial Comment:
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);"


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=2504323&group_id=51305

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
wxCode-users mailing list
wxCode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxcode-users

Reply via email to