Fixing null pointer exception
This commit is contained in:
parent
4dfdd41c08
commit
688fc30b6f
@ -35,7 +35,6 @@ msCoreControllerLoadGame (const unsigned char *rom, size_t rom_len,
|
||||
if (!core) {
|
||||
ms_last_error = "This rom does not appear to be a GBA or GB/C one";
|
||||
file_rom->close(file_rom);
|
||||
file_state->close(file_rom);
|
||||
goto loadGameReturn;
|
||||
}
|
||||
core->init(core);
|
||||
|
@ -101,6 +101,9 @@ msPacketHelloHandle(const struct msPacket *packet, struct msPacketHello *hello,
|
||||
}
|
||||
printf("Loading game and save for client_fd %d\n", data->clientFd);
|
||||
data->coreController = msCoreControllerLoadGame(hello->rom, hello->sizeRom, hello->savestate, hello->sizeSavestate, data);
|
||||
if (!data->coreController) {
|
||||
goto return_ms_packet_hello_handle;
|
||||
}
|
||||
msCoreControllerSetFrameCallback(data->coreController, &msThreadCallbackSetFrame);
|
||||
msCoreControllerSetStartCallback(data->coreController, &msThreadCallbackStart);
|
||||
msCoreControllerThreadStart(data->coreController);
|
||||
|
Loading…
Reference in New Issue
Block a user