forked from boostorg/regex
Fixed copy self assignment bug
[SVN r12248]
This commit is contained in:
1 parent
52dbd281ca
commit
e22aaa9d20
1 file changed
+14
-8
@@ -218,17 +218,23 @@ jm_debug_alloc::jm_debug_alloc()
|
||||
|
||||
jm_debug_alloc::jm_debug_alloc(const jm_debug_alloc& d)
|
||||
{
|
||||
blocks = d.blocks;
|
||||
count = d.count;
|
||||
++(*count);
|
||||
guard = this;
|
||||
if(&d != this)
|
||||
{
|
||||
blocks = d.blocks;
|
||||
count = d.count;
|
||||
++(*count);
|
||||
guard = this;
|
||||
}
|
||||
}
|
||||
jm_debug_alloc& jm_debug_alloc::operator=(const jm_debug_alloc& d)
|
||||
{
|
||||
free_();
|
||||
blocks = d.blocks;
|
||||
count = d.count;
|
||||
++(*count);
|
||||
if(&d != this)
|
||||
{
|
||||
free_();
|
||||
blocks = d.blocks;
|
||||
count = d.count;
|
||||
++(*count);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user