From 484efe776b9a80d9492fa5779e770cc0f233ca36 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 14 Jul 2008 14:53:08 +0000 Subject: Added an exit function to the SH2 drc so that it doesn't leak memory like crazy. --- src/emu/cpu/sh2/sh2drc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c index eec2da3ef4e..0378c5e9eef 100644 --- a/src/emu/cpu/sh2/sh2drc.c +++ b/src/emu/cpu/sh2/sh2drc.c @@ -637,6 +637,19 @@ static void sh2_init(int index, int clock, const void *config, int (*irqcallback sh2->cache_dirty = TRUE; } +/*------------------------------------------------- + sh2_exit - cleanup from execution +-------------------------------------------------*/ + +static void sh2_exit(void) +{ + /* clean up the DRC */ + drcfe_exit(sh2->drcfe); + drcuml_free(sh2->drcuml); + drccache_free(sh2->cache); +} + + /*------------------------------------------------- sh2_reset - reset the processor -------------------------------------------------*/ @@ -3266,6 +3279,7 @@ void sh2_get_info(UINT32 state, cpuinfo *info) case CPUINFO_PTR_SET_CONTEXT: info->setcontext = sh2_set_context; break; case CPUINFO_PTR_INIT: info->init = sh2_init; break; case CPUINFO_PTR_RESET: info->reset = sh2_reset; break; + case CPUINFO_PTR_EXIT: info->exit = sh2_exit; break; case CPUINFO_PTR_EXECUTE: info->execute = sh2_execute; break; case CPUINFO_PTR_BURN: info->burn = NULL; break; case CPUINFO_PTR_DISASSEMBLE: info->disassemble = sh2_dasm; break; -- cgit v1.2.3