aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sludge/builtin.cpp6
-rw-r--r--engines/sludge/floor.cpp4
-rw-r--r--engines/sludge/language.cpp2
-rw-r--r--engines/sludge/newfatal.cpp4
-rw-r--r--engines/sludge/sludger.cpp10
-rw-r--r--engines/sludge/statusba.cpp2
-rw-r--r--engines/sludge/talk.cpp2
-rw-r--r--engines/sludge/variable.cpp6
8 files changed, 18 insertions, 18 deletions
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index b15ed01b70..131a90351e 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -180,7 +180,7 @@ static builtReturn sayCore(int numParams, loadedFunction *fun, bool sayIt) {
fun->timeLeft = p;
//debugOut ("BUILTIN: sayCore: %s (%i)\n", newText, p);
fun->isSpeech = true;
- delete newText;
+ delete[] newText;
newText = NULL;
return BR_KEEP_AND_PAUSE;
}
@@ -887,7 +887,7 @@ builtIn(setFont) {
if (!loadFont(fileNumber, newText, newHeight))
return BR_ERROR;
// newDebug (" Done!");
- delete newText;
+ delete[] newText;
return BR_CONTINUE;
}
@@ -1862,7 +1862,7 @@ builtIn(statusText) {
return BR_ERROR;
trimStack(fun->stack);
setStatusBar(newText);
- delete newText;
+ delete[] newText;
return BR_CONTINUE;
}
diff --git a/engines/sludge/floor.cpp b/engines/sludge/floor.cpp
index a402ef9ef2..e556463738 100644
--- a/engines/sludge/floor.cpp
+++ b/engines/sludge/floor.cpp
@@ -231,10 +231,10 @@ bool setFloor(int fileNum) {
} while (madeChange);
for (i = 0; i < currentFloor->numPolygons; i++) {
- delete distanceMatrix[i];
+ delete[] distanceMatrix[i];
}
- delete distanceMatrix;
+ delete []distanceMatrix;
distanceMatrix = NULL;
setResourceForFatal(-1);
diff --git a/engines/sludge/language.cpp b/engines/sludge/language.cpp
index b0b3a8e1c0..cb055f930a 100644
--- a/engines/sludge/language.cpp
+++ b/engines/sludge/language.cpp
@@ -76,7 +76,7 @@ char *getPrefsFilename(char *filename) {
char *joined = joinStrings(f, ".ini");
- delete filename;
+ delete[] filename;
filename = NULL;
return joined;
}
diff --git a/engines/sludge/newfatal.cpp b/engines/sludge/newfatal.cpp
index bc97d6a610..a44290ab36 100644
--- a/engines/sludge/newfatal.cpp
+++ b/engines/sludge/newfatal.cpp
@@ -81,7 +81,7 @@ void warning(const char *l) {
}
void registerWindowForFatal() {
- delete fatalInfo;
+ delete[] fatalInfo;
fatalInfo =
joinStrings("There's an error with this SLUDGE game! If you're designing this game, please turn on verbose error messages in the project manager and recompile. If not, please contact the author saying where and how this problem occured.", "");
}
@@ -126,7 +126,7 @@ int checkNew(const void *mem) {
}
void setFatalInfo(const char *userFunc, const char *BIF) {
- delete fatalInfo;
+ delete[] fatalInfo;
fatalInfo = new char[strlen(userFunc) + strlen(BIF) + 38];
if (fatalInfo)
sprintf(fatalInfo, "Currently in this sub: %s\nCalling: %s", userFunc, BIF);
diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp
index e9c724399f..4743649018 100644
--- a/engines/sludge/sludger.cpp
+++ b/engines/sludge/sludger.cpp
@@ -266,7 +266,7 @@ bool initSludge(const char *filename) {
if (strcmp(checker, "okSoFar"))
return fatal(ERROR_BAD_HEADER, filename);
- delete checker;
+ delete[] checker;
checker = NULL;
unsigned char customIconLogo = fp->readByte();
@@ -509,7 +509,7 @@ bool initSludge(const char *filename) {
char *gameName = encodeFilename(gameNameOrig);
- delete gameNameOrig;
+ delete[] gameNameOrig;
#if 0
changeToUserDir();
@@ -767,10 +767,10 @@ void finishFunction(loadedFunction *fun) {
pauseFunction(fun);
if (fun->stack)
fatal(ERROR_NON_EMPTY_STACK);
- delete fun->compiledLines;
+ delete[] fun->compiledLines;
for (a = 0; a < fun->numLocals; a++)
unlinkVar(fun->localVars[a]);
- delete fun->localVars;
+ delete[] fun->localVars;
unlinkVar(fun->reg);
delete fun;
fun = NULL;
@@ -785,7 +785,7 @@ void abortFunction(loadedFunction *fun) {
delete fun->compiledLines;
for (a = 0; a < fun->numLocals; a++)
unlinkVar(fun->localVars[a]);
- delete fun->localVars;
+ delete[] fun->localVars;
unlinkVar(fun->reg);
if (fun->calledBy)
abortFunction(fun->calledBy);
diff --git a/engines/sludge/statusba.cpp b/engines/sludge/statusba.cpp
index 0ebe4e7363..9af0f3f512 100644
--- a/engines/sludge/statusba.cpp
+++ b/engines/sludge/statusba.cpp
@@ -78,7 +78,7 @@ void addStatusBar() {
void setStatusBar(char *txt) {
if (nowStatus->firstStatusBar) {
- delete nowStatus->firstStatusBar->text;
+ delete[] nowStatus->firstStatusBar->text;
nowStatus->firstStatusBar->text = copyString(txt);
}
}
diff --git a/engines/sludge/talk.cpp b/engines/sludge/talk.cpp
index 162875cb8a..7663d39c04 100644
--- a/engines/sludge/talk.cpp
+++ b/engines/sludge/talk.cpp
@@ -70,7 +70,7 @@ void killAllSpeech() {
while (speech->allSpeech) {
killMe = speech->allSpeech;
speech->allSpeech = speech->allSpeech->next;
- delete killMe->textLine;
+ delete[] killMe->textLine;
delete killMe;
}
}
diff --git a/engines/sludge/variable.cpp b/engines/sludge/variable.cpp
index 73e90f0b16..e811c65f15 100644
--- a/engines/sludge/variable.cpp
+++ b/engines/sludge/variable.cpp
@@ -336,14 +336,14 @@ char *getTextFromAnyVar(const variable &from) {
builder2 = joinStrings(builder, " ");
if (!builder2)
return NULL;
- delete builder;
+ delete[] builder;
grabText = getTextFromAnyVar(stacky->thisVar);
builder = joinStrings(builder2, grabText);
if (!builder)
return NULL;
- delete grabText;
+ delete[] grabText;
grabText = NULL;
- delete builder2;
+ delete[] builder2;
builder2 = NULL;
stacky = stacky->next;
}