X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8497bbf52d4f7e37a6555040ae7def97d2618fe0..0ed77610ccfedff8cdf0876fdbd0a801decb255b:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index a2994e1679..e9917ab6df 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4163,7 +4163,7 @@ wxGrid::wxGrid( wxWindow *parent, m_rowMinHeights(GRID_HASH_SIZE) { Create(); - SetBestFittingSize(size); + SetInitialSize(size); } bool wxGrid::Create(wxWindow *parent, wxWindowID id, @@ -4178,7 +4178,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id, m_rowMinHeights = wxLongToLongHashMap(GRID_HASH_SIZE); Create(); - SetBestFittingSize(size); + SetInitialSize(size); return true; } @@ -4198,8 +4198,12 @@ wxGrid::~wxGrid() total ? (gs_nAttrCacheHits*100) / total : 0); #endif - if (m_ownTable) + // if we own the table, just delete it, otherwise at least don't leave it + // with dangling view pointer + if ( m_ownTable ) delete m_table; + else if ( m_table->GetView() == this ) + m_table->SetView(NULL); delete m_typeRegistry; delete m_selection; @@ -7708,10 +7712,10 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) int i, j, cell_rows, cell_cols; wxRect rect; - for (j=topRow; j 1) || (cell_cols > 1))