Skip to content

Commit

Permalink
removeFunction: Clear the slot so it doesn't keep things alive (#20213)
Browse files Browse the repository at this point in the history
  • Loading branch information
unilynx authored Sep 11, 2023
1 parent e4f78e7 commit a754738
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/library_addfunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,11 @@ addToLibrary({
return ret;
},

$removeFunction__deps: ['$functionsInTableMap', '$freeTableIndexes', '$getWasmTableEntry'],
$removeFunction__deps: ['$functionsInTableMap', '$freeTableIndexes',
'$getWasmTableEntry', '$setWasmTableEntry'],
$removeFunction: (index) => {
functionsInTableMap.delete(getWasmTableEntry(index));
setWasmTableEntry(index, null);
freeTableIndexes.push(index);
},
});
Expand Down

0 comments on commit a754738

Please sign in to comment.