File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
system/include/emscripten Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,7 @@ var LibraryEmVal = {
8080
8181 _emval_free__deps : [ '$emval_handles' ] ,
8282 _emval_free : ( handle ) => {
83- if ( handle >= emval_handles . reserved ) {
84- emval_handles . free ( handle ) ;
85- }
83+ emval_handles . free ( handle ) ;
8684 } ,
8785
8886 _emval_run_destructors__deps : [ '_emval_free' , '$Emval' , '$runDestructors' ] ,
Original file line number Diff line number Diff line change @@ -38,9 +38,10 @@ void _emval_register_symbol(const char*);
3838
3939enum {
4040 _EMVAL_UNDEFINED = 1 ,
41- _EMVAL_NULL = 2 ,
42- _EMVAL_TRUE = 3 ,
43- _EMVAL_FALSE = 4
41+ _EMVAL_NULL,
42+ _EMVAL_TRUE,
43+ _EMVAL_FALSE,
44+ _EMVAL_UNRESERVED_START
4445};
4546
4647typedef struct _EM_DESTRUCTORS * EM_DESTRUCTORS;
@@ -322,7 +323,9 @@ struct val_metadata {
322323
323324 // should be only accessible from dec_ref
324325 ~val_metadata () {
325- _emval_free (handle);
326+ if (handle >= EM_VAL (internal::_EMVAL_UNRESERVED_START)) {
327+ internal::_emval_free (handle);
328+ }
326329 }
327330};
328331
You can’t perform that action at this time.
0 commit comments