diff --git a/Source/kwsys/auto_ptr.hxx.in b/Source/kwsys/auto_ptr.hxx.in index f068c9f25..6b0befc61 100644 --- a/Source/kwsys/auto_ptr.hxx.in +++ b/Source/kwsys/auto_ptr.hxx.in @@ -55,7 +55,7 @@ public: auto_ptr(auto_ptr_ref r) throw(): x_(r.p_.release()) {} template operator auto_ptr_ref() throw() { return auto_ptr_ref(*this); } template operator auto_ptr() throw() { return release(); } - auto_ptr& operator=(auto_ptr_ref r) throw() { x_ = r.p_.release(); return *this; } + auto_ptr& operator=(auto_ptr_ref r) throw() { reset(r.p_.release()); return *this; } }; } // namespace @KWSYS_NAMESPACE@