diff --git a/code/BoostWorkaround/boost/shared_ptr.hpp b/code/BoostWorkaround/boost/shared_ptr.hpp index ffac65992..8c816d751 100644 --- a/code/BoostWorkaround/boost/shared_ptr.hpp +++ b/code/BoostWorkaround/boost/shared_ptr.hpp @@ -20,13 +20,16 @@ namespace boost { template controller(T* ptr) - : cnt(1) + : cnt(ptr?1:0) {} public: template controller* decref(T* pt) { + if (!pt) { + return NULL; + } if (--cnt <= 0) { delete this; delete pt;