Skip to content

Commit

Permalink
compiler: fix compiledModule leak
Browse files Browse the repository at this point in the history
Fixes #1600.

Signed-off-by: Nuno Cruces <[email protected]>
  • Loading branch information
ncruces committed Aug 1, 2023
1 parent 1f8c908 commit 6fb8e9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/engine/compiler/engine_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import (
func (e *engine) deleteCompiledModule(module *wasm.Module) {
e.mux.Lock()
defer e.mux.Unlock()

cm := e.codes[module.ID]
for j := range cm.functions {
cm.functions[j].parent = nil
}
delete(e.codes, module.ID)

// Note: we do not call e.Cache.Delete, as the lifetime of
Expand Down

0 comments on commit 6fb8e9c

Please sign in to comment.