From bbce4547cf424fe4eae22ab6deef2bd88b65b8f0 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 29 Dec 2022 14:02:01 +0100 Subject: [PATCH] fix bug in blocking thread --- src/ipblc/inc.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ipblc/inc.rs b/src/ipblc/inc.rs index e1e6b2e..88a8578 100644 --- a/src/ipblc/inc.rs +++ b/src/ipblc/inc.rs @@ -118,8 +118,10 @@ async fn watchfiles(ctx: &Arc>) -> Receiver { loop { let events: Vec; { - let ctx = ctx.lock().await; - events = ctx.instance.read_events().unwrap(); + let c = ctx.lock().await; + let instance = c.instance.clone(); + drop(c); + events = instance.read_events().unwrap(); } for inevent in events {