X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fedad417ce939cbb0ddb519e9777145c76712cb8..b6f5f27a330a5f3f05ee4824270e7dc692441d42:/src/mac/carbon/palette.cpp

diff --git a/src/mac/carbon/palette.cpp b/src/mac/carbon/palette.cpp
index 1c18196135..c847131f40 100644
--- a/src/mac/carbon/palette.cpp
+++ b/src/mac/carbon/palette.cpp
@@ -36,7 +36,10 @@ wxPaletteRefData::wxPaletteRefData()
 
 wxPaletteRefData::~wxPaletteRefData()
 {
-	delete[] m_palette ;
+    if (m_palette != NULL) {
+        delete[] m_palette ;
+        m_palette = NULL;
+    }
 }
 
 wxPalette::wxPalette()