From 0c24af112de24d92c05c179b2dbe693ae8f1b97a Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sun, 8 Nov 2020 09:58:15 +0000 Subject: [PATCH] Fixed two issues found with valgrind: Since runtime parameters are revoved by the destructor, the main parameters must be removed after deleting device object. --- bochs/iodev/parallel.cc | 4 ++-- bochs/iodev/sound/es1370.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bochs/iodev/parallel.cc b/bochs/iodev/parallel.cc index 84b338e7c..10fdcf1d5 100644 --- a/bochs/iodev/parallel.cc +++ b/bochs/iodev/parallel.cc @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2001-2017 The Bochs Project +// Copyright (C) 2001-2020 The Bochs Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -118,6 +118,7 @@ void CDECL libparallel_LTX_plugin_fini(void) { char port[10]; + delete theParallelDevice; bx_list_c *menu = (bx_list_c*)SIM->get_param("ports.parallel"); for (int i=0; iremove(port); } - delete theParallelDevice; } // the device object diff --git a/bochs/iodev/sound/es1370.cc b/bochs/iodev/sound/es1370.cc index e557dc064..db3c796a6 100644 --- a/bochs/iodev/sound/es1370.cc +++ b/bochs/iodev/sound/es1370.cc @@ -200,10 +200,10 @@ int CDECL libes1370_LTX_plugin_init(plugin_t *plugin, plugintype_t type) void CDECL libes1370_LTX_plugin_fini(void) { + delete theES1370Device; SIM->unregister_addon_option("es1370"); bx_list_c *menu = (bx_list_c*)SIM->get_param("sound"); menu->remove("es1370"); - delete theES1370Device; } // the device object