X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad7502d8612afcc113eaffffeb6c1c6f8e9d0f58..c95340c23404e3bc64993dc01d97969ed3c87e58:/src/generic/grid.cpp?ds=sidebyside diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 4b73fdedf9..bdd93204b5 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -9944,9 +9944,14 @@ void wxGrid::ClearAttrCache() { if ( m_attrCache.row != -1 ) { - wxSafeDecRef(m_attrCache.attr); + wxGridCellAttr *oldAttr = m_attrCache.attr; m_attrCache.attr = NULL; m_attrCache.row = -1; + // wxSafeDecRec(...) might cause event processing that accesses + // the cached attribute, if one exists (e.g. by deleting the + // editor stored within the attribute). Therefore it is important + // to invalidate the cache before calling wxSafeDecRef! + wxSafeDecRef(oldAttr); } } @@ -10189,7 +10194,7 @@ void wxGrid::SetCellSize( int row, int col, int num_rows, int num_cols ) wxT("wxGrid::SetCellSize setting cell size to < 1")); // if this was already a multicell then "turn off" the other cells first - if ((cell_rows > 1) || (cell_rows > 1)) + if ((cell_rows > 1) || (cell_cols > 1)) { int i, j; for (j=row; j < row + cell_rows; j++)