X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d35dec9b1197a2d6eb0a43f14561a548a45d520f..222702b112dcc7bebe018d6f4d66fe469fefd02c:/src/x11/colour.cpp diff --git a/src/x11/colour.cpp b/src/x11/colour.cpp index b334a9b931..a9c177d209 100644 --- a/src/x11/colour.cpp +++ b/src/x11/colour.cpp @@ -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; @@ -231,7 +232,6 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue ) { AllocExclusive(); - m_refData = new wxColourRefData(); #if wxUSE_NANOX M_COLDATA->m_color.red = ((unsigned short)red) ; M_COLDATA->m_color.green = ((unsigned short)green) ;