aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-01-22 18:28:22 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:23:31 +0300
commitbf8a0f22d50d3ee8e19d9ec72a5ff563d42c570a (patch)
tree9546d59e6910256284c96a1d420dd1d9e8784be2
parent50e05c30bfcdf3b1c8aea0be0b631233e24f694c (diff)
Depending on the order of construction and destruction of val objects, count_emval_handles could be incorrect.
-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