diff options
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index e412fcdf748..0e0d8982527 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -105,11 +105,16 @@ static BlendFileData *load_game_data(char *filename) { fseek(file, 0L, SEEK_SET); char* filebuffer= new char[len];//MEM_mallocN(len, "text_buffer"); int sizeread = fread(filebuffer,len,1,file); - if (sizeread==1) - { + if (sizeread==1){ bfd = BLO_read_from_memory(filebuffer, len, &error); + } else { + error = BRE_UNABLE_TO_READ; } fclose(file); + // the memory is not released in BLO_read_from_memory, must do it here + delete filebuffer; + } else { + error = BRE_UNABLE_TO_OPEN; } if (!bfd) { @@ -348,7 +353,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, initGameKeys(); initPythonConstraintBinding(); - + if (sceneconverter) { // convert and add scene |