From 7832b586e6adeac2b5de7f1f59b8dfb9f8fb1905 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 15 Jun 2012 01:00:50 +0000 Subject: [PATCH] Small detail in constructors --- wrap/matlab.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wrap/matlab.h b/wrap/matlab.h index 483326720..365e11f39 100644 --- a/wrap/matlab.h +++ b/wrap/matlab.h @@ -321,20 +321,21 @@ public: // Constructor for free-store allocated objects. // Creates shared pointer, will delete if is last one to hold pointer ObjectHandle(T* ptr) : - type(&typeid(T)), t(boost::shared_ptr (ptr)) { + type(&typeid(T)), t(ptr) { signature = this; } // Constructor for shared pointers // Creates shared pointer, will delete if is last one to hold pointer - ObjectHandle(boost::shared_ptr ptr) : - /*type(&typeid(T)),*/ t(ptr) { + ObjectHandle(boost::shared_ptr shared_ptr) : + /*type(&typeid(T)),*/ t(shared_ptr) { signature = this; } ~ObjectHandle() { // object is in shared_ptr, will be automatically deleted signature = 0; // destroy signature + // std::cout << "ObjectHandle destructor" << std::endl; } // Get the actual object contained by handle