From fe4563b4f810bdb946fbe120f5849f8ff2d02ec8 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Fri, 26 Jan 2024 09:00:07 +0100 Subject: [PATCH] Remove lua app data executor ref when done --- lib/runtime.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/runtime.rs b/lib/runtime.rs index 44c0b6c..b537974 100644 --- a/lib/runtime.rs +++ b/lib/runtime.rs @@ -1,4 +1,4 @@ -use std::sync::Arc; +use std::sync::{Arc, Weak}; use mlua::prelude::*; use smol::prelude::*; @@ -218,6 +218,9 @@ impl<'lua> Runtime<'lua> { }; main_exec.run(fut).await; + + // Make sure we don't leave any references behind + self.lua.remove_app_data::>(); } /**