Fix #2432801 - Make SwigValueWrapper exception safe for when copy constructors throw exceptions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10997 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a648bb7f38
commit
7adb84f448
2 changed files with 5 additions and 1 deletions
|
|
@ -647,7 +647,7 @@ public:
|
|||
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
|
||||
SwigValueWrapper(const T& t) : tt(new T(t)) { }
|
||||
~SwigValueWrapper() { delete tt; }
|
||||
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
|
||||
SwigValueWrapper& operator=(const T& t) { T *oldtt = tt; tt = 0; delete oldtt; tt = new T(t); return *this; }
|
||||
operator T&() const { return *tt; }
|
||||
T *operator&() { return tt; }
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue