Skip to content
Permalink
Browse files
Fixed issue #1 - Filehandle leak eventually crashed the emulator
  • Loading branch information
0xe1f committed May 26, 2013
1 parent 00c7900 commit da4f38e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
@@ -1,2 +1,3 @@
CocoaMSX.xcodeproj/xcuserdata
CocoaMSX.xcodeproj/project.xcworkspace
.DS_Store
@@ -579,6 +579,8 @@ Machine* machineCreate(const char* machineName)
return NULL; // Not compressed and no config.ini
}

fclose(file);

machine->zipFile = (char *)calloc(strlen(zipFile) + 1, sizeof(char));
strcpy(machine->zipFile, zipFile);

@@ -641,7 +643,7 @@ int machineIsValid(const char* machineName, int checkRoms)
{
if (machine->isZipped)
{
#ifdef COCOAMSX
#ifdef __APPLE__
int location = unzLocateFile(zippedMachine,
machine->slotInfo[i].inZipName, 2);
#else
@@ -271,7 +271,7 @@ void* _zipLoadFile(const char* zipName, const char* fileName, int* size, zlib_fi
return NULL;
}

#ifdef COCOAMSX
#ifdef __APPLE__
// Most OS X installs are on a case-insensitive FS
if (unzLocateFile(zip, name, 2) == UNZ_END_OF_LIST_OF_FILE) {
#else
@@ -470,7 +470,7 @@ int zipFileExists(const char* zipName, const char* fileName)
return 0;
}

#ifdef COCOAMSX
#ifdef __APPLE__
// Most OS X installs are on a case-insensitive FS
if (unzLocateFile(zip, name, 2) == UNZ_END_OF_LIST_OF_FILE) {
#else

0 comments on commit da4f38e

Please sign in to comment.