Applied fix for wxGrid::ClearAttrCache (#9712).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2008-07-09 17:25:32 +00:00
parent 8827d7b444
commit 1989629a23

View File

@@ -10029,9 +10029,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);
}
}