summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2021-02-20 12:47:26 -0800
committerMichael Pavone <pavone@retrodev.com>2021-02-20 12:47:26 -0800
commitbb5b3179fd704f53af1f75a02b3faf7cec9b7407 (patch)
tree683189d6dc715c2e8a46bcdd586509e5bf95bb7f
parent6990568d41c9756eff8fd0913f649dbc63c5ba8d (diff)
Close VDP debug windows when VDP is freed. Fixes Trac bug 39
-rw-r--r--vdp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vdp.c b/vdp.c
index 86c4d54..18b2eae 100644
--- a/vdp.c
+++ b/vdp.c
@@ -254,6 +254,15 @@ vdp_context *init_vdp_context(uint8_t region_pal, uint8_t has_max_vsram)
void vdp_free(vdp_context *context)
{
+ if (headless) {
+ free(context->fb);
+ }
+ for (int i = 0; i < VDP_NUM_DEBUG_TYPES; i++)
+ {
+ if (context->enabled_debuggers & (1 << i)) {
+ vdp_toggle_debug_view(context, i);
+ }
+ }
free(context);
}