[ wxwindows-Bugs-1768000 ] wxGrid crash when doing delayed Create()

SourceForge.net noreply at sourceforge.net
Wed Aug 8 02:50:06 PDT 2007


Bugs item #1768000, was opened at 2007-08-05 19:17
Message generated for change (Settings changed) made by neis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1768000&group_id=9863

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: Grid
Group: None
>Status: Closed
Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Peter Amstutz (tetron)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxGrid crash when doing delayed Create()

Initial Comment:
Using wxWidgets 2.8.4 on Windows.

Doing a delayed Create() of wxGrid, it crashes with the supplied stack trace.  The problem stems from the fact that it is trying to determine the size of the grid control before the grid control has been properly initialized.  The solution appears to be to ensure that the control avoid processing size events until it has been properly constructed.

Proposed fix (solves the problem for me) to src/generic/grid.cpp, line 6906:

void wxGrid::OnSize( wxSizeEvent& WXUNUSED(event) )
{
    // update our children window positions and scrollbars
-    CalcDimensions();
+    if (m_gridWin) CalcDimensions();
}


Stack trace:

>	wxmsw28ud_adv_vc_custom.dll!wxGridCellAttr::IncRef()  Line 664 + 0xa bytes	C++
 	wxmsw28ud_adv_vc_custom.dll!wxGrid::GetCellAttr(int row=-1, int col=-1)  Line 9949	C++
 	wxmsw28ud_adv_vc_custom.dll!wxGrid::IsCellEditControlShown()  Line 8302 + 0x10 bytes	C++
 	wxmsw28ud_adv_vc_custom.dll!wxGrid::CalcDimensions()  Line 4612 + 0x8 bytes	C++
 	wxmsw28ud_adv_vc_custom.dll!wxGrid::OnSize(wxSizeEvent & __formal={...})  Line 6911	C++
 	wxbase28ud_vc_custom.dll!wxAppConsole::HandleEvent(wxEvtHandler * handler=0x01e028b8, void (wxEvent &)* func=0x00f41154, wxEvent & event={...})  Line 321	C++
 	wxbase28ud_vc_custom.dll!wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase & entry={...}, wxEvtHandler * handler=0x01e028b8, wxEvent & event={...})  Line 1206	C++
 	wxbase28ud_vc_custom.dll!wxEventHashTable::HandleEvent(wxEvent & event={...}, wxEvtHandler * self=0x01e028b8)  Line 878 + 0x1c bytes	C++
 	wxbase28ud_vc_custom.dll!wxEvtHandler::ProcessEvent(wxEvent & event={...})  Line 1266 + 0x1c bytes	C++
 	wxbase28ud_vc_custom.dll!wxEvtHandler::ProcessEvent(wxEvent & event={...})  Line 1273 + 0x1c bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxScrollHelperEvtHandler::ProcessEvent(wxEvent & event={...})  Line 211 + 0xd bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxWindow::HandleSize(int __formal=4, int __formal=4, unsigned int wParam=0)  Line 4671 + 0x1c bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxWindow::MSWWindowProc(unsigned int message=5, unsigned int wParam=0, long lParam=262148)  Line 2574 + 0x26 bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxScrolledWindow::MSWWindowProc(unsigned int nMsg=5, unsigned int wParam=0, long lParam=262148)  Line 1386 + 0x14 bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxWndProc(HWND__ * hWnd=0x0005040e, unsigned int message=5, unsigned int wParam=0, long lParam=262148)  Line 2528 + 0x1c bytes	C++
 	user32.dll!7e418734() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]	
 	user32.dll!7e418816() 	
 	user32.dll!7e41b4c0() 	
 	user32.dll!7e41b50c() 	
 	ntdll.dll!7c90eae3() 	
 	user32.dll!7e41fe13() 	
 	user32.dll!7e41fdd9() 	
 	ntdll.dll!7c949d18() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c949b34() 	
 	ntdll.dll!7c949b34() 	
 	ntdll.dll!7c926a44() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c949b34() 	
 	ntdll.dll!7c926a44() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c91b686() 	
 	ntdll.dll!7c91b298() 	
 	ntdll.dll!7c9106eb() 	
 	ntdll.dll!7c926a44() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c96e0d4() 	
 	ntdll.dll!7c91b686() 	
 	ntdll.dll!7c91b298() 	
 	ntdll.dll!7c9106eb() 	
 	ntdll.dll!7c96e0f0() 	
 	ntdll.dll!7c96e0d4() 	
 	ntdll.dll!7c9268ad() 	
 	ntdll.dll!7c96e0d4() 	
 	ntdll.dll!7c94a5d0() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c95db5c() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c9268ad() 	
 	ntdll.dll!7c91056d() 	
 	ntdll.dll!7c95db5c() 	
 	ntdll.dll!7c96cd11() 	
 	ntdll.dll!7c960bf0() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c9268ad() 	
 	ntdll.dll!7c91056d() 	
 	ntdll.dll!7c91056d() 	
 	msvcr80d.dll!009ae713() 	
 	ntdll.dll!7c910833() 	
 	user32.dll!7e41fecc() 	
 	msvcr80d.dll!0096fc25() 	
 	user32.dll!7e41fc58() 	
 	wxmsw28ud_core_vc_custom.dll!wxWindow::MSWCreate(const wchar_t * wclass=0x00d26e60, const wchar_t * title=0x00000000, const wxPoint & pos={...}, const wxSize & size={...}, unsigned long style=1378877440, unsigned long extendedStyle=0)  Line 3431 + 0x6a bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxWindow::Create(wxWindow * parent=0x01b2e028, int id=-1, const wxPoint & pos={...}, const wxSize & size={...}, long style=-1073479680, const wxString & name={...})  Line 584 + 0x21 bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxPanel::Create(wxWindow * parent=0x01b2e028, int id=-1, const wxPoint & pos={...}, const wxSize & size={...}, long style=-1073479680, const wxString & name={...})  Line 117 + 0x20 bytes	C++
 	wxmsw28ud_core_vc_custom.dll!wxScrolledWindow::Create(wxWindow * parent=0x01b2e028, int id=-1, const wxPoint & pos={...}, const wxSize & size={...}, long style=262144, const wxString & name={...})  Line 1363 + 0x2a bytes	C++
 	wxmsw28ud_adv_vc_custom.dll!wxGrid::Create(wxWindow * parent=0x01b2e028, int id=-1, const wxPoint & pos={...}, const wxSize & size={...}, long style=262144, const wxString & name={...})  Line 4183 + 0x27 bytes	C++
 	wxtest.exe!VectorEditMode::Create(VobjectView * parent=0x01b2e028)  Line 17 + 0x42 bytes	C++
 	wxtest.exe!VobjectView::SetupMode(const wxString & mode={...})  Line 72 + 0x1d bytes	C++


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

Comment By: Stefan Neis (neis)
Date: 2007-08-08 09:46

Message:
Logged In: YES 
user_id=32202
Originator: NO

Duplicates #1765117

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1768000&group_id=9863




More information about the wx-dev mailing list