(MESS) fix some crash on exit. nw.

This commit is contained in:
Fabio Priuli 2013-02-16 08:02:08 +00:00
parent a571252867
commit e99fd1b730
2 changed files with 4 additions and 4 deletions

View file

@ -538,7 +538,7 @@ int base_md_cart_slot_device::load_nonlist()
void base_md_cart_slot_device::call_unload()
{
if (m_cart->get_nvram_size())
if (m_cart && m_cart->get_nvram_size())
battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size());
}

View file

@ -1,6 +1,6 @@
#include "emu.h"
#include "machine/nes_slot.h"
#include "hashfile.h"
#include "machine/nes_slot.h"
#define NES_BATTERY_SIZE 0x2000
@ -1112,9 +1112,9 @@ bool nes_cart_slot_device::call_load()
void nes_cart_slot_device::call_unload()
{
if (m_cart->get_battery_size())
if (m_cart && m_cart->get_battery_size())
battery_save(m_cart->get_battery_base(), m_cart->get_battery_size());
if (m_cart->get_mapper_bram_size())
if (m_cart && m_cart->get_mapper_bram_size())
battery_save(m_cart->get_mapper_bram_base(), m_cart->get_mapper_bram_size());
}