diff --git a/Source/Glitch64/OGLglitchmain.cpp b/Source/Glitch64/OGLglitchmain.cpp index a0d6ea674..96683e994 100644 --- a/Source/Glitch64/OGLglitchmain.cpp +++ b/Source/Glitch64/OGLglitchmain.cpp @@ -122,9 +122,18 @@ FullScreenResolutions::~FullScreenResolutions() for (unsigned int i = 0; i < dwNumResolutions; i++) { delete[] aResolutionsStr[i]; + aResolutionsStr[i] = NULL; + } + if (aResolutionsStr) + { + delete[] aResolutionsStr; + aResolutionsStr = NULL; + } + if (aResolutions) + { + delete[] aResolutions; + aResolutions = NULL; } - delete[] aResolutionsStr; - delete[] aResolutions; } void FullScreenResolutions::init()