summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-12-11 11:03:11 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-12-11 11:03:11 +0000
commit7eaa676d90817c0e4af7e7d0f04986cfa78bddcd (patch)
tree74554dc0161cefbd05faa64b2ca738d72a484fb7 /src/emu/debug
parent9ff94341461ec0772aab68cfca373c3e2ff8d0cc (diff)
Fixed compile error, and fixed crash when handling an exception when the
debugger is disabled.
Diffstat (limited to 'src/emu/debug')
-rw-r--r--src/emu/debug/debugcpu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index cbbf2dd04fb..7600af442f2 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -272,12 +272,15 @@ void debug_cpu_init(running_machine *machine)
void debug_cpu_flush_traces(running_machine *machine)
{
int cpunum;
-
+
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
if (machine->cpu[cpunum] != NULL)
{
cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]);
- if (info->trace.file != NULL)
+
+ /* this can be called on exit even when no debugging is enabled, so
+ make sure the info is valid before proceeding */
+ if (info != NULL && info->trace.file != NULL)
fflush(info->trace.file);
}
}