forked from boostorg/regex
Fixed copy self assignment bug
[SVN r12248]
This commit is contained in:
@ -217,18 +217,24 @@ jm_debug_alloc::jm_debug_alloc()
|
|||||||
}
|
}
|
||||||
|
|
||||||
jm_debug_alloc::jm_debug_alloc(const jm_debug_alloc& d)
|
jm_debug_alloc::jm_debug_alloc(const jm_debug_alloc& d)
|
||||||
|
{
|
||||||
|
if(&d != this)
|
||||||
{
|
{
|
||||||
blocks = d.blocks;
|
blocks = d.blocks;
|
||||||
count = d.count;
|
count = d.count;
|
||||||
++(*count);
|
++(*count);
|
||||||
guard = this;
|
guard = this;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
jm_debug_alloc& jm_debug_alloc::operator=(const jm_debug_alloc& d)
|
jm_debug_alloc& jm_debug_alloc::operator=(const jm_debug_alloc& d)
|
||||||
|
{
|
||||||
|
if(&d != this)
|
||||||
{
|
{
|
||||||
free_();
|
free_();
|
||||||
blocks = d.blocks;
|
blocks = d.blocks;
|
||||||
count = d.count;
|
count = d.count;
|
||||||
++(*count);
|
++(*count);
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user