This commit is contained in:
Lior Halphon 2017-10-04 13:14:37 +03:00
parent d171a0ccee
commit 947c62bea9

View File

@ -24,7 +24,7 @@ static char *battery_save_path_ptr;
void set_filename(const char *new_filename, bool new_should_free) void set_filename(const char *new_filename, bool new_should_free)
{ {
if (filename && should_free_filename) { if (filename && should_free_filename) {
free(filename); SDL_free(filename);
} }
filename = (char *) new_filename; filename = (char *) new_filename;
should_free_filename = new_should_free; should_free_filename = new_should_free;
@ -98,7 +98,7 @@ static void handle_events(GB_gameboy_t *gb)
exit(0); exit(0);
case SDL_DROPFILE: { case SDL_DROPFILE: {
set_filename(filename, true); set_filename(event.drop.file, true);
pending_command = GB_SDL_NEW_FILE_COMMAND; pending_command = GB_SDL_NEW_FILE_COMMAND;
break; break;
} }