Leak of ConnectionInner
Seems at some point we've started to leak ConnectionInner
, most likely through some cyclic Arc references. You can see the leak through applying this patch:
diff --git a/zbus/src/azync/connection.rs b/zbus/src/azync/connection.rs
index 09cf2cdc..c7a465d3 100644
--- a/zbus/src/azync/connection.rs
+++ b/zbus/src/azync/connection.rs
@@ -127,6 +127,12 @@ struct ConnectionInner {
signal_subscriptions: Mutex<HashMap<u64, SignalSubscription>>,
}
+impl Drop for ConnectionInner {
+ fn drop(&mut self) {
+ println!("Conn: {:?} dropped", self);
+ }
+}
+
and running cargo t basic_iface -- --nocapture
(it won't print anything).
While my PR (!377 (merged)) avoids more cyclic refs, it unfortunately doesn't address this issue fully. However, I've a feeling that the new internal WeakConnection
API !377 (merged) adds, will be helpful in solving this regression.
Edited by Zeeshan Ali Khan