svn-id: r50924
This commit is contained in:
Torbjörn Andersson 2010-07-16 03:14:03 +00:00
parent d20ae841dd
commit bcb4c49a03
6 changed files with 21 additions and 39 deletions

View file

@ -197,11 +197,9 @@ void RegisterActors(int num) {
} }
void FreeActors() { void FreeActors() {
if (actorInfo) {
free(actorInfo); free(actorInfo);
actorInfo = NULL; actorInfo = NULL;
} }
}
/** /**
* Called from dec_lead(), i.e. normally once at start of master script. * Called from dec_lead(), i.e. normally once at start of master script.

View file

@ -730,16 +730,12 @@ void BMVPlayer::FinishBMV() {
stream.close(); stream.close();
// Release the data buffer // Release the data buffer
if (bigBuffer != NULL) {
free(bigBuffer); free(bigBuffer);
bigBuffer = NULL; bigBuffer = NULL;
}
// Release the screen buffer // Release the screen buffer
if (screenBuffer != NULL) {
free(screenBuffer); free(screenBuffer);
screenBuffer = NULL; screenBuffer = NULL;
}
// Ditch any text objects // Ditch any text objects
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {

View file

@ -175,21 +175,17 @@ void SetupHandleTable() {
} }
void FreeHandleTable() { void FreeHandleTable() {
if (handleTable) {
free(handleTable); free(handleTable);
handleTable = NULL; handleTable = NULL;
}
if (cdGraphStream) {
delete cdGraphStream; delete cdGraphStream;
cdGraphStream = 0; cdGraphStream = NULL;
}
} }
/** /**
* Loads a memory block as a file. * Loads a memory block as a file.
*/ */
void OpenCDGraphFile() { void OpenCDGraphFile() {
if (cdGraphStream)
delete cdGraphStream; delete cdGraphStream;
// As the theory goes, the right CD will be in there! // As the theory goes, the right CD will be in there!

View file

@ -49,11 +49,9 @@ static int maxObj = 0;
#endif #endif
void FreeObjectList() { void FreeObjectList() {
if (objectList) {
free(objectList); free(objectList);
objectList = NULL; objectList = NULL;
} }
}
/** /**
* Kills all objects and places them on the free list. * Kills all objects and places them on the free list.

View file

@ -162,11 +162,9 @@ void InitialiseSaveScenes() {
} }
void FreeSaveScenes() { void FreeSaveScenes() {
if (ssData) {
free(ssData); free(ssData);
ssData = NULL; ssData = NULL;
} }
}
/** /**
* Checks that all non-moving actors are playing the same reel as when * Checks that all non-moving actors are playing the same reel as when

View file

@ -88,11 +88,9 @@ void ChangeLanguage(LANGUAGE newLang) {
textLanguage = newLang; textLanguage = newLang;
sampleLanguage = newLang; sampleLanguage = newLang;
if (textBuffer) {
// free the previous buffer // free the previous buffer
free(textBuffer); free(textBuffer);
textBuffer = NULL; textBuffer = NULL;
}
// Try and open the specified language file. If it fails, and the language // Try and open the specified language file. If it fails, and the language
// isn't English, try falling back on opening 'english.txt' - some foreign // isn't English, try falling back on opening 'english.txt' - some foreign
@ -355,11 +353,9 @@ int SubStringCount(int id) {
void FreeTextBuffer() { void FreeTextBuffer() {
if (textBuffer) {
free(textBuffer); free(textBuffer);
textBuffer = NULL; textBuffer = NULL;
} }
}
/** /**
* Called from TINLIB.C from DeclareLanguage(). * Called from TINLIB.C from DeclareLanguage().