Fix shared_ptr workaround.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@635 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2010-04-02 23:41:20 +00:00
parent f9b4a825aa
commit 6db8987248
1 changed files with 4 additions and 1 deletions

View File

@ -20,13 +20,16 @@ namespace boost {
template <typename T>
controller(T* ptr)
: cnt(1)
: cnt(ptr?1:0)
{}
public:
template <typename T>
controller* decref(T* pt) {
if (!pt) {
return NULL;
}
if (--cnt <= 0) {
delete this;
delete pt;