File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
system/include/emscripten Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ var LibraryEmVal = {
8080
8181 _emval_free__deps : [ '$emval_handles' ] ,
8282 _emval_free : ( handle ) => {
83- emval_handles . free ( handle ) ;
83+ if ( handle >= emval_handles . reserved ) {
84+ emval_handles . free ( handle ) ;
85+ }
8486 } ,
8587
8688 _emval_run_destructors__deps : [ '_emval_free' , '$Emval' , '$runDestructors' ] ,
Original file line number Diff line number Diff line change @@ -38,10 +38,9 @@ void _emval_register_symbol(const char*);
3838
3939enum {
4040 _EMVAL_UNDEFINED = 1 ,
41- _EMVAL_NULL,
42- _EMVAL_TRUE,
43- _EMVAL_FALSE,
44- _EMVAL_UNRESERVED_START
41+ _EMVAL_NULL = 2 ,
42+ _EMVAL_TRUE = 3 ,
43+ _EMVAL_FALSE = 4
4544};
4645
4746typedef struct _EM_DESTRUCTORS * EM_DESTRUCTORS;
@@ -340,9 +339,7 @@ struct val_metadata {
340339
341340 // should be only accessible from dec_ref
342341 ~val_metadata () {
343- if (handle >= EM_VAL (internal::_EMVAL_UNRESERVED_START)) {
344- internal::_emval_free (handle);
345- }
342+ _emval_free (handle);
346343 }
347344};
348345
You can’t perform that action at this time.
0 commit comments