mirror of
https://github.com/boostorg/exception.git
synced 2025-07-21 08:22:05 +02:00
workaround for double-destruction bugs in compilers: with this, boost::exception objects should survive the case when the destructor is called twice.
[SVN r61602]
This commit is contained in:
@ -75,8 +75,8 @@ boost
|
|||||||
void
|
void
|
||||||
release()
|
release()
|
||||||
{
|
{
|
||||||
if( px_ )
|
if( px_ && px_->release() )
|
||||||
px_->release();
|
px_=0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ boost
|
|||||||
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
|
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
|
||||||
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
|
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
|
||||||
virtual void add_ref() const = 0;
|
virtual void add_ref() const = 0;
|
||||||
virtual void release() const = 0;
|
virtual bool release() const = 0;
|
||||||
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
|
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -140,11 +140,16 @@ boost
|
|||||||
++count_;
|
++count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
release() const
|
release() const
|
||||||
{
|
{
|
||||||
if( !--count_ )
|
if( --count_ )
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
{
|
||||||
delete this;
|
delete this;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
refcount_ptr<error_info_container>
|
refcount_ptr<error_info_container>
|
||||||
|
@ -28,11 +28,16 @@ test_type
|
|||||||
++count_;
|
++count_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
release()
|
release()
|
||||||
{
|
{
|
||||||
if( !--count_ )
|
if( --count_ )
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
{
|
||||||
delete this;
|
delete this;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user