summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/embind/embind.js2
-rw-r--r--src/embind/emval.js5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 56f3520a..f63a8eff 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -409,7 +409,7 @@ function __embind_register_smart_ptr(
return new Handle(ptr);
},
toWireType: function(destructors, o) {
- return o.ptr;
+ return o.smartPointer;
}
};
}
diff --git a/src/embind/emval.js b/src/embind/emval.js
index 9574ab37..26ceaf46 100644
--- a/src/embind/emval.js
+++ b/src/embind/emval.js
@@ -13,12 +13,17 @@ Module.count_emval_handles = function() {
return _emval_handle_array.length;
};
+Module.reset_emval_handles = function() {
+ _emval_handle_array = [];
+ _emval_free_list = [];
+}
// Private C++ API
function __emval_register(value) {
var handle = _emval_free_list.length ?
_emval_free_list.pop() :
_emval_handle_array.length;
+
_emval_handle_array[handle] = {refcount: 1, value: value};
return handle;
}