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 = {
80
80
81
81
_emval_free__deps : [ '$emval_handles' ] ,
82
82
_emval_free : ( handle ) => {
83
- emval_handles . free ( handle ) ;
83
+ if ( handle >= emval_handles . reserved ) {
84
+ emval_handles . free ( handle ) ;
85
+ }
84
86
} ,
85
87
86
88
_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*);
38
38
39
39
enum {
40
40
_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
45
44
};
46
45
47
46
typedef struct _EM_DESTRUCTORS * EM_DESTRUCTORS;
@@ -340,9 +339,7 @@ struct val_metadata {
340
339
341
340
// should be only accessible from dec_ref
342
341
~val_metadata () {
343
- if (handle >= EM_VAL (internal::_EMVAL_UNRESERVED_START)) {
344
- internal::_emval_free (handle);
345
- }
342
+ _emval_free (handle);
346
343
}
347
344
};
348
345
You can’t perform that action at this time.
0 commit comments