Mercurial > repos > blastem
comparison blastem.c @ 2430:fb8d6ebf9d5f
Fix crash when loading new ROM via drag/drop when existing ROM has lock-on
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 06 Feb 2024 06:34:49 -0800 |
parents | 65c2e4d990cc |
children | bed4d3db8a3f |
comparison
equal
deleted
inserted
replaced
2429:da3dc881d3f0 | 2430:fb8d6ebf9d5f |
---|---|
387 if (current_system && current_system->config_updated) { | 387 if (current_system && current_system->config_updated) { |
388 current_system->config_updated(current_system); | 388 current_system->config_updated(current_system); |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 static system_media cart, lock_on; | |
392 static void on_drag_drop(char *filename) | 393 static void on_drag_drop(char *filename) |
393 { | 394 { |
394 if (current_system) { | 395 if (current_system) { |
395 if (current_system->next_rom) { | 396 if (current_system->next_rom) { |
396 free(current_system->next_rom); | 397 free(current_system->next_rom); |
402 if (gen->extra) { | 403 if (gen->extra) { |
403 menu_context *menu = gen->extra; | 404 menu_context *menu = gen->extra; |
404 menu->external_game_load = 1; | 405 menu->external_game_load = 1; |
405 } | 406 } |
406 } | 407 } |
408 cart.chain = NULL; | |
407 } else { | 409 } else { |
408 init_system_with_media(filename, SYSTEM_UNKNOWN); | 410 init_system_with_media(filename, SYSTEM_UNKNOWN); |
409 } | 411 } |
410 #ifndef DISABLE_NUKLEAR | 412 #ifndef DISABLE_NUKLEAR |
411 if (is_nuklear_active()) { | 413 if (is_nuklear_active()) { |
412 show_play_view(); | 414 show_play_view(); |
413 } | 415 } |
414 #endif | 416 #endif |
415 } | 417 } |
416 | 418 |
417 static system_media cart, lock_on; | |
418 const system_media *current_media(void) | 419 const system_media *current_media(void) |
419 { | 420 { |
420 return &cart; | 421 return &cart; |
421 } | 422 } |
422 | 423 |