aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-03-01 17:31:44 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:24:47 +0300
commitececfcc02e2020c2c965cb0d6edc0fc321def581 (patch)
treebdb0a5dd575d8ae6f5aba035b031cbc3691d6421 /src
parent50c5092c4a37565558e6ffab7602e778b6774e2a (diff)
Add support for marshalling custom smart pointer types in and out of parameters.
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);
}