fix crash in gbagame slot2 addon when gba rom doesn't exist
This commit is contained in:
parent
bf911bf571
commit
aba30866b1
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2009 CrazyMax
|
Copyright (C) 2009 CrazyMax
|
||||||
Copyright (C) 2009-2015 DeSmuME team
|
Copyright (C) 2009-2016 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -359,15 +359,14 @@ public:
|
||||||
|
|
||||||
printf("GBASlot opening ROM: %s\n", GBACartridge_RomPath.c_str());
|
printf("GBASlot opening ROM: %s\n", GBACartridge_RomPath.c_str());
|
||||||
EMUFILE_FILE *inf = new EMUFILE_FILE(GBACartridge_RomPath, "rb");
|
EMUFILE_FILE *inf = new EMUFILE_FILE(GBACartridge_RomPath, "rb");
|
||||||
inf->EnablePositionCache();
|
|
||||||
fROM = inf;
|
fROM = inf;
|
||||||
if (fROM->fail())
|
if (fROM->fail())
|
||||||
{
|
{
|
||||||
printf(" - Failed\n");
|
printf(" - Failed\n");
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
inf->EnablePositionCache();
|
||||||
|
|
||||||
romSize = fROM->size();
|
romSize = fROM->size();
|
||||||
printf(" - Success (%u bytes)\n", romSize);
|
printf(" - Success (%u bytes)\n", romSize);
|
||||||
|
|
Loading…
Reference in New Issue