Fixed copy self assignment bug

[SVN r12248]
This commit is contained in:
John Maddock
2002-01-08 13:00:08 +00:00
parent 52dbd281ca
commit e22aaa9d20

View File

@ -217,18 +217,24 @@ jm_debug_alloc::jm_debug_alloc()
}
jm_debug_alloc::jm_debug_alloc(const jm_debug_alloc& d)
{
if(&d != this)
{
blocks = d.blocks;
count = d.count;
++(*count);
guard = this;
}
}
jm_debug_alloc& jm_debug_alloc::operator=(const jm_debug_alloc& d)
{
if(&d != this)
{
free_();
blocks = d.blocks;
count = d.count;
++(*count);
}
return *this;
}