diff options
author | Chad Austin <chad@imvu.com> | 2013-01-22 18:28:22 -0800 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:23:31 +0300 |
commit | bf8a0f22d50d3ee8e19d9ec72a5ff563d42c570a (patch) | |
tree | 9546d59e6910256284c96a1d420dd1d9e8784be2 | |
parent | 50e05c30bfcdf3b1c8aea0be0b631233e24f694c (diff) |
Depending on the order of construction and destruction of val objects, count_emval_handles could be incorrect.
-rwxr-xr-x | src/embind/emval.js | 8 |
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 |