]> git.saurik.com Git - wxWidgets.git/commitdiff
check if wxTheApp still exists in FreeColour(); fixes crash on shutdown
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 23:42:45 +0000 (23:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 23:42:45 +0000 (23:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/colour.cpp

index b334a9b931d4e41aa879903634a204052b3d4163..9ce03f2d5b94e88f5c6d649bcfb951a08597c61c 100644 (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;