]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/colour.cpp
Simplified and extended compiler detection for OS/2.
[wxWidgets.git] / src / x11 / colour.cpp
index b334a9b931d4e41aa879903634a204052b3d4163..9ce03f2d5b94e88f5c6d649bcfb951a08597c61c 100644 (file)
@@ -93,8 +93,9 @@ void wxColourRefData::FreeColour()
     if (!m_colormap)
         return;
 #if !wxUSE_NANOX
     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;
     {
         int idx = m_color.pixel;
         colMapAllocCounter[ idx ] = colMapAllocCounter[ idx ] - 1;