From c6be22e1b4018b0eeac0a3b84febfb0be5170e4f Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Wed, 2 Mar 2022 15:35:26 +0900 Subject: [PATCH 1/2] change host_state drop order to drop artifact first --- lib/api/src/sys/module.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/src/sys/module.rs b/lib/api/src/sys/module.rs index 27df4fd6f31..da19a36778a 100644 --- a/lib/api/src/sys/module.rs +++ b/lib/api/src/sys/module.rs @@ -268,7 +268,7 @@ impl Module { let instance_handle = self.artifact.instantiate( self.store.tunables(), resolver, - Box::new((self.store.clone(), self.artifact.clone())), + Box::new((self.artifact.clone(), self.store.clone())), )?; // After the instance handle is created, we need to initialize From 2f104609259efe11fc6230be59b595aff928d29d Mon Sep 17 00:00:00 2001 From: Yun Yeo Date: Fri, 4 Mar 2022 10:15:27 +0900 Subject: [PATCH 2/2] move drop responsibility to the module itself --- lib/api/src/sys/module.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/src/sys/module.rs b/lib/api/src/sys/module.rs index da19a36778a..51e42fe22bc 100644 --- a/lib/api/src/sys/module.rs +++ b/lib/api/src/sys/module.rs @@ -268,7 +268,7 @@ impl Module { let instance_handle = self.artifact.instantiate( self.store.tunables(), resolver, - Box::new((self.artifact.clone(), self.store.clone())), + Box::new(self.clone()), )?; // After the instance handle is created, we need to initialize