From ececfcc02e2020c2c965cb0d6edc0fc321def581 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Fri, 1 Mar 2013 17:31:44 -0800 Subject: Add support for marshalling custom smart pointer types in and out of parameters. --- src/embind/embind.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 has an identical binary layout to + // smart_ptr. 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); } -- cgit v1.2.3-70-g09d2