Fix shared_ptr workaround.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@635 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
f9b4a825aa
commit
6db8987248
|
@ -20,13 +20,16 @@ namespace boost {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
controller(T* ptr)
|
controller(T* ptr)
|
||||||
: cnt(1)
|
: cnt(ptr?1:0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
controller* decref(T* pt) {
|
controller* decref(T* pt) {
|
||||||
|
if (!pt) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (--cnt <= 0) {
|
if (--cnt <= 0) {
|
||||||
delete this;
|
delete this;
|
||||||
delete pt;
|
delete pt;
|
||||||
|
|
Loading…
Reference in New Issue