check if wxTheApp still exists in FreeColour(); fixes crash on shutdown

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-07-25 23:42:45 +00:00
parent 3cd2f0bdee
commit ac7f6cf0a9

View File

@ -93,8 +93,9 @@ void wxColourRefData::FreeColour()
if (!m_colormap)
return;
#if !wxUSE_NANOX
if ((wxTheApp->m_visualInfo->m_visualType == GrayScale) ||
(wxTheApp->m_visualInfo->m_visualType == PseudoColor))
if ( wxTheApp &&
(wxTheApp->m_visualInfo->m_visualType == GrayScale ||
wxTheApp->m_visualInfo->m_visualType == PseudoColor) )
{
int idx = m_color.pixel;
colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] - 1;