mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-31 00:04:36 +02:00
Merge pull request #450 from Kontinuation/develop
Make the copy assignment operator of Exception class exception safe
This commit is contained in:
commit
edcd9fd2fb
@ -65,9 +65,10 @@ Exception& Exception::operator = (const Exception& exc)
|
|||||||
{
|
{
|
||||||
if (&exc != this)
|
if (&exc != this)
|
||||||
{
|
{
|
||||||
|
Exception *new_pNested = exc._pNested? exc._pNested->clone() : 0;
|
||||||
delete _pNested;
|
delete _pNested;
|
||||||
_msg = exc._msg;
|
_msg = exc._msg;
|
||||||
_pNested = exc._pNested ? exc._pNested->clone() : 0;
|
_pNested = new_pNested;
|
||||||
_code = exc._code;
|
_code = exc._code;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user