aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/embind/embind.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 8da583ba..3ecea3e0 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -601,7 +601,13 @@ RegisteredPointer.prototype.toWireType = function(destructors, handle) {
}
var ptr = staticPointerCast(handle.$$.ptr, fromRawType, this.pointeeType.rawType);
if (this.isSmartPointer) {
- ptr = handle.$$.pointeeType.smartPointerType.rawConstructor(ptr, handle.$$.smartPtr);
+ // If this is for smart ptr type conversion, I think it
+ // assumes that smart_ptr<T> has an identical binary layout to
+ // smart_ptr<U>. I wonder if that's untrue for any common
+ // smart pointer. - chad
+ ptr = handle.$$.pointeeType.smartPointerType.rawConstructor(
+ ptr,
+ handle.$$.smartPtr);
destructors.push(handle.$$.pointeeType.smartPointerType.rawDestructor);
destructors.push(ptr);
}