diff --git a/bochs/cpu/icache.h b/bochs/cpu/icache.h index c01c54d08..0a3bd94ca 100755 --- a/bochs/cpu/icache.h +++ b/bochs/cpu/icache.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: icache.h,v 1.17 2006-05-19 20:04:33 sshwarts Exp $ +// $Id: icache.h,v 1.18 2006-09-20 20:52:23 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -55,6 +55,9 @@ public: BX_CPP_INLINE void alloc(Bit32u memSize) { + if (memSizeInBytes > 0) { + delete [] pageWriteStampTable; + } memSizeInBytes = memSize; pageWriteStampTable = new Bit32u [memSizeInBytes>>12]; resetWriteStamps(); diff --git a/bochs/iodev/devices.cc b/bochs/iodev/devices.cc index c357fbe24..c5213824e 100644 --- a/bochs/iodev/devices.cc +++ b/bochs/iodev/devices.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: devices.cc,v 1.110 2006-09-20 18:24:17 vruppert Exp $ +// $Id: devices.cc,v 1.111 2006-09-20 20:52:23 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -119,27 +119,19 @@ void bx_devices_c::init(BX_MEM_C *newmem) unsigned i; const char def_name[] = "Default"; - BX_DEBUG(("Init $Id: devices.cc,v 1.110 2006-09-20 18:24:17 vruppert Exp $")); + BX_DEBUG(("Init $Id: devices.cc,v 1.111 2006-09-20 20:52:23 vruppert Exp $")); mem = newmem; /* set no-default handlers, will be overwritten by the real default handler */ + register_default_io_read_handler(NULL, &default_read_handler, def_name, 7); io_read_handlers.next = &io_read_handlers; io_read_handlers.prev = &io_read_handlers; - io_read_handlers.handler_name = new char[strlen(def_name)+1]; - strcpy(io_read_handlers.handler_name, def_name); - io_read_handlers.funct = (void *)&default_read_handler; - io_read_handlers.this_ptr = NULL; io_read_handlers.usage_count = 0; // not used with the default handler - io_read_handlers.mask = 7; - + + register_default_io_write_handler(NULL, &default_write_handler, def_name, 7); io_write_handlers.next = &io_write_handlers; io_write_handlers.prev = &io_write_handlers; - io_write_handlers.handler_name = new char[strlen(def_name)+1]; - strcpy(io_write_handlers.handler_name, def_name); - io_write_handlers.funct = (void *)&default_write_handler; - io_write_handlers.this_ptr = NULL; io_write_handlers.usage_count = 0; // not used with the default handler - io_write_handlers.mask = 7; if (read_port_to_handler) delete [] read_port_to_handler; diff --git a/bochs/iodev/ne2k.cc b/bochs/iodev/ne2k.cc index 5eae06569..be3d10cdb 100644 --- a/bochs/iodev/ne2k.cc +++ b/bochs/iodev/ne2k.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: ne2k.cc,v 1.89 2006-09-10 17:18:44 vruppert Exp $ +// $Id: ne2k.cc,v 1.90 2006-09-20 20:52:23 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -66,11 +66,15 @@ bx_ne2k_c::bx_ne2k_c() put("NE2K"); settype(NE2KLOG); s.tx_timer_index = BX_NULL_TIMER_HANDLE; + ethdev = NULL; } bx_ne2k_c::~bx_ne2k_c() { + if (ethdev != NULL) { + delete ethdev; + } BX_DEBUG(("Exit")); } @@ -1404,7 +1408,7 @@ void bx_ne2k_c::init(void) char devname[16]; bx_list_c *base; - BX_DEBUG(("Init $Id: ne2k.cc,v 1.89 2006-09-10 17:18:44 vruppert Exp $")); + BX_DEBUG(("Init $Id: ne2k.cc,v 1.90 2006-09-20 20:52:23 vruppert Exp $")); // Read in values from config interface base = (bx_list_c*) SIM->get_param(BXPN_NE2K);