uses checked_delete instead of plain delete

This commit is contained in:
Arvid Norberg 2007-10-30 10:08:09 +00:00
parent df7e01ff8a
commit e28689237d
1 changed files with 2 additions and 1 deletions

View File

@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_INTRUSIVE_PTR_BASE
#include <boost/detail/atomic_count.hpp>
#include <boost/checked_delete.hpp>
#include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp"
@ -60,7 +61,7 @@ namespace libtorrent
TORRENT_ASSERT(s->m_refs > 0);
TORRENT_ASSERT(s != 0);
if (--s->m_refs == 0)
delete static_cast<T const*>(s);
boost::checked_delete(static_cast<T const*>(s));
}
boost::intrusive_ptr<T> self()