Cleanup.
svn-id: r50924
This commit is contained in:
parent
d20ae841dd
commit
bcb4c49a03
6 changed files with 21 additions and 39 deletions
|
@ -197,10 +197,8 @@ void RegisterActors(int num) {
|
|||
}
|
||||
|
||||
void FreeActors() {
|
||||
if (actorInfo) {
|
||||
free(actorInfo);
|
||||
actorInfo = NULL;
|
||||
}
|
||||
free(actorInfo);
|
||||
actorInfo = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -730,16 +730,12 @@ void BMVPlayer::FinishBMV() {
|
|||
stream.close();
|
||||
|
||||
// Release the data buffer
|
||||
if (bigBuffer != NULL) {
|
||||
free(bigBuffer);
|
||||
bigBuffer = NULL;
|
||||
}
|
||||
free(bigBuffer);
|
||||
bigBuffer = NULL;
|
||||
|
||||
// Release the screen buffer
|
||||
if (screenBuffer != NULL) {
|
||||
free(screenBuffer);
|
||||
screenBuffer = NULL;
|
||||
}
|
||||
free(screenBuffer);
|
||||
screenBuffer = NULL;
|
||||
|
||||
// Ditch any text objects
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
|
|
@ -175,22 +175,18 @@ void SetupHandleTable() {
|
|||
}
|
||||
|
||||
void FreeHandleTable() {
|
||||
if (handleTable) {
|
||||
free(handleTable);
|
||||
handleTable = NULL;
|
||||
}
|
||||
if (cdGraphStream) {
|
||||
delete cdGraphStream;
|
||||
cdGraphStream = 0;
|
||||
}
|
||||
free(handleTable);
|
||||
handleTable = NULL;
|
||||
|
||||
delete cdGraphStream;
|
||||
cdGraphStream = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a memory block as a file.
|
||||
*/
|
||||
void OpenCDGraphFile() {
|
||||
if (cdGraphStream)
|
||||
delete cdGraphStream;
|
||||
delete cdGraphStream;
|
||||
|
||||
// As the theory goes, the right CD will be in there!
|
||||
|
||||
|
|
|
@ -49,10 +49,8 @@ static int maxObj = 0;
|
|||
#endif
|
||||
|
||||
void FreeObjectList() {
|
||||
if (objectList) {
|
||||
free(objectList);
|
||||
objectList = NULL;
|
||||
}
|
||||
free(objectList);
|
||||
objectList = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -162,10 +162,8 @@ void InitialiseSaveScenes() {
|
|||
}
|
||||
|
||||
void FreeSaveScenes() {
|
||||
if (ssData) {
|
||||
free(ssData);
|
||||
ssData = NULL;
|
||||
}
|
||||
free(ssData);
|
||||
ssData = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -88,11 +88,9 @@ void ChangeLanguage(LANGUAGE newLang) {
|
|||
textLanguage = newLang;
|
||||
sampleLanguage = newLang;
|
||||
|
||||
if (textBuffer) {
|
||||
// free the previous buffer
|
||||
free(textBuffer);
|
||||
textBuffer = NULL;
|
||||
}
|
||||
// free the previous buffer
|
||||
free(textBuffer);
|
||||
textBuffer = NULL;
|
||||
|
||||
// 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
|
||||
|
@ -355,10 +353,8 @@ int SubStringCount(int id) {
|
|||
|
||||
|
||||
void FreeTextBuffer() {
|
||||
if (textBuffer) {
|
||||
free(textBuffer);
|
||||
textBuffer = NULL;
|
||||
}
|
||||
free(textBuffer);
|
||||
textBuffer = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue