Skip to content

Commit 28a33a5

Browse files
committed
optimize recover logic
Signed-off-by: zty98751 <[email protected]>
1 parent cad2eb0 commit 28a33a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/proxy-wasm/wasm.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ class WasmBase : public std::enable_shared_from_this<WasmBase> {
7575
}
7676
void clearWasmInContext() {
7777
for (auto &item : contexts_) {
78-
item.second->clearWasm();
78+
if (item.second != nullptr) {
79+
item.second->clearWasm();
80+
}
7981
}
82+
contexts_.clear();
8083
}
8184
uint32_t allocContextId();
8285
bool isFailed() { return failed_ != FailState::Ok; }

0 commit comments

Comments
 (0)