aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/embind/emval.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/embind/emval.js b/src/embind/emval.js
index 39f23a61..e6ba566a 100755
--- a/src/embind/emval.js
+++ b/src/embind/emval.js
@@ -10,7 +10,13 @@ var _emval_free_list = [];
/** @expose */
Module.count_emval_handles = function() {
- return _emval_handle_array.length;
+ var count = 0;
+ for (var i = 0; i < _emval_handle_array.length; ++i) {
+ if (_emval_handle_array[i] !== undefined) {
+ ++count;
+ }
+ }
+ return count;
};
// Private C++ API