aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-03-07 15:42:13 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:25:11 +0300
commit6a0976ce2e1006cda317625e294aa878045e305a (patch)
treea1442219595ce0b43be79f1ac720cda42f3c22d7 /system
parent612340cec2f3761efffc450e1de0adb445a45036 (diff)
checkpoint work towards unifying the binding type for classes and smart pointers.
Diffstat (limited to 'system')
-rwxr-xr-xsystem/include/emscripten/bind.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index e8a8dc1d..7dcfa61b 100755
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -543,7 +543,11 @@ namespace emscripten {
typename smart_ptr_trait<SmartPointerType>::element_type* ptr,
SmartPointerType* basePtr
) {
- return new SmartPointerType(smart_ptr_trait<SmartPointerType>::share(*basePtr, ptr));
+ if (ptr) {
+ return new SmartPointerType(smart_ptr_trait<SmartPointerType>::share(*basePtr, ptr));
+ } else {
+ return new SmartPointerType;
+ }
}
template<typename PointerType>