mirror of https://github.com/bochs-emu/Bochs
- fixed several instances where we had "delete array" but we needed
"delete [] array". This led to memory leaks. Thanks, valgrind.
This commit is contained in:
parent
c67a497100
commit
dcc6df2f1e
|
@ -1,5 +1,5 @@
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: sb16.cc,v 1.18 2002-01-29 17:20:12 vruppert Exp $
|
||||
// $Id: sb16.cc,v 1.19 2002-04-09 20:12:39 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
|
@ -90,7 +90,7 @@ bx_sb16_c::~bx_sb16_c(void)
|
|||
|
||||
delete(BX_SB16_OUTPUT);
|
||||
|
||||
delete(DSP.dma.chunk);
|
||||
delete [] DSP.dma.chunk;
|
||||
|
||||
if ((bx_options.sb16.Ologlevel->get () > 0) && LOGFILE)
|
||||
fclose(LOGFILE);
|
||||
|
@ -3185,7 +3185,7 @@ void bx_sb16_buffer::reset()
|
|||
bx_sb16_buffer::~bx_sb16_buffer(void)
|
||||
{
|
||||
if (buffer != NULL)
|
||||
delete buffer;
|
||||
delete [] buffer;
|
||||
|
||||
buffer = NULL;
|
||||
length = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: misc_mem.cc,v 1.17 2001-11-14 01:39:22 bdenney Exp $
|
||||
// $Id: misc_mem.cc,v 1.18 2002-04-09 20:12:39 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
|
@ -77,7 +77,7 @@ BX_MEM_C::BX_MEM_C(size_t memsize)
|
|||
BX_MEM_C::~BX_MEM_C(void)
|
||||
{
|
||||
if (this-> vector != NULL) {
|
||||
delete this->vector;
|
||||
delete [] this->vector;
|
||||
}
|
||||
else {
|
||||
BX_DEBUG(("(%u) memory not freed as it wasn't allocated!", BX_SIM_ID));
|
||||
|
@ -90,7 +90,7 @@ BX_MEM_C::~BX_MEM_C(void)
|
|||
void
|
||||
BX_MEM_C::init_memory(int memsize)
|
||||
{
|
||||
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.17 2001-11-14 01:39:22 bdenney Exp $"));
|
||||
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.18 2002-04-09 20:12:39 bdenney Exp $"));
|
||||
// you can pass 0 if memory has been allocated already through
|
||||
// the constructor, or the desired size of memory if it hasn't
|
||||
|
||||
|
|
Loading…
Reference in New Issue