From 1a98ae6284dbbcdfd852b55c997b10b63c109f4a Mon Sep 17 00:00:00 2001 From: ugetab Date: Thu, 8 Apr 2010 01:57:15 +0000 Subject: [PATCH] Fixed conditional debugging text loading on second+ game load. Variable cleanup was mainly using free(), but code was testing prior usage with if(variable) coding, evaluating to true from the random data, and feeding the freed variables to functions. --- src/drivers/win/pref.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/drivers/win/pref.cpp b/src/drivers/win/pref.cpp index 2d15335f..7072419d 100644 --- a/src/drivers/win/pref.cpp +++ b/src/drivers/win/pref.cpp @@ -223,6 +223,19 @@ int loadDebuggerPreferences(FILE* f) myNumWPs = 0; + // Ugetab: + // This took far too long to figure out... + // Nullifying the data is better than using free(), because + // a simple if(watchpoint[i].cond) can still evaluate to true. + // This causes several tests to fail, one of which kills + // conditional text loading when reusing a used condText. + for (i=0;i<65;i++) + { + watchpoint[i].cond = NULL; + watchpoint[i].condText = NULL; + watchpoint[i].desc = NULL; + } + // Read the breakpoints for (i=0;i<65;i++) {