Skip to content

Commit d9ccfde

Browse files
committed
invoke on_context_create_ for multiple root contexts
Signed-off-by: mathetake <[email protected]>
1 parent 49ed20e commit d9ccfde

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/context.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,15 @@ bool ContextBase::onStart(std::shared_ptr<PluginBase> plugin) {
331331
}
332332

333333
bool ContextBase::onConfigure(std::shared_ptr<PluginBase> plugin) {
334+
if (!in_vm_context_created_ && wasm_->on_context_create_) {
335+
wasm_->on_context_create_(this, id_, 0);
336+
in_vm_context_created_ = true;
337+
}
338+
334339
if (isFailed() || !wasm_->on_configure_) {
335340
return true;
336341
}
342+
337343
DeferAfterCallActions actions(this);
338344
plugin_ = plugin;
339345
auto result =

0 commit comments

Comments
 (0)