diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/embind/embind.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index aab20b69..8da583ba 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -601,11 +601,7 @@ RegisteredPointer.prototype.toWireType = function(destructors, handle) { } var ptr = staticPointerCast(handle.$$.ptr, fromRawType, this.pointeeType.rawType); if (this.isSmartPointer) { - // todo: if ptr == handle.$$.ptr, there's no need to allocate a new smartPtr! - // todo: _malloc(16) is not big enough - var smartPtr = _malloc(16); - handle.$$.pointeeType.smartPointerType.rawConstructor(smartPtr, ptr, handle.$$.smartPtr); - ptr = smartPtr; + ptr = handle.$$.pointeeType.smartPointerType.rawConstructor(ptr, handle.$$.smartPtr); destructors.push(handle.$$.pointeeType.smartPointerType.rawDestructor); destructors.push(ptr); } |