diff options
author | Bill Welden <bwelden@imvu.com> | 2013-01-11 14:28:56 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:23:06 +0300 |
commit | d0969fc651367d801d28146ef6f4dbe1d26f2aa2 (patch) | |
tree | b94bf4726e2d819242b331068ebe6cf05f99a86a /system | |
parent | c59bb0d3975d7e15faaab87f785ae66bf6730f35 (diff) |
o Temporary shared pointers created to hold upcast argument values now share ownership with the original pointer.
o New test cases for edge cases.
o Other minor clean-up.
Diffstat (limited to 'system')
-rwxr-xr-x | system/include/emscripten/bind.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index bbce9a93..652fb1b4 100755 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -96,7 +96,6 @@ namespace emscripten { void _embind_register_smart_ptr( TYPEID pointerType, TYPEID pointeeType, - bool isPolymorphic, const char* pointerName, GenericFunction constructor, GenericFunction destructor, @@ -322,12 +321,12 @@ namespace emscripten { ); } - template<typename PointerType> - void nullDeallocator(PointerType* p) {} +// template<typename PointerType> +// void nullDeallocator(PointerType* p) {} template<typename PointerType> - typename std::shared_ptr<PointerType> raw_smart_pointer_constructor(PointerType *ptr, void (PointerType*)) { - return std::shared_ptr<PointerType>(ptr, nullDeallocator<PointerType>); + typename std::shared_ptr<PointerType> raw_smart_pointer_constructor(PointerType *ptr, std::shared_ptr<PointerType> basePtr, void (PointerType*)) { + return std::shared_ptr<PointerType>(basePtr, ptr); } template<typename ClassType> @@ -620,7 +619,6 @@ namespace emscripten { _embind_register_smart_ptr( TypeID<PointerType>::get(), TypeID<PointeeType>::get(), - std::is_polymorphic<PointeeType>::value, name, reinterpret_cast<GenericFunction>(&raw_smart_pointer_constructor<PointeeType*>), reinterpret_cast<GenericFunction>(&raw_destructor<PointerType>), |