diff --git a/wasm_parts/main.go b/wasm_parts/main.go index e0e44304..0dcfae36 100644 --- a/wasm_parts/main.go +++ b/wasm_parts/main.go @@ -33,7 +33,11 @@ var data = map[uint32]*ctx{} //export createCtx func createCtx(id uint32) { - data[id] = &ctx{} + ctxId := gcContext.GetContextID() + gcContext.SetContext(id) + c := &ctx{} + gcContext.SetContext(ctxId) + data[id] = c } //export alloc diff --git a/wasm_parts/main.wasm.gz b/wasm_parts/main.wasm.gz index 115f57b5..9eae59b3 100644 Binary files a/wasm_parts/main.wasm.gz and b/wasm_parts/main.wasm.gz differ