We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c689935 commit 0ac4615Copy full SHA for 0ac4615
src/session.rs
@@ -296,7 +296,7 @@ impl _PullSubscriber {
296
}
297
298
#[pyclass(subclass)]
299
-pub struct _Scout(Scout<()>);
+pub struct _Scout(Option<Scout<()>>);
300
301
#[pyfunction]
302
pub fn scout(
@@ -315,7 +315,13 @@ pub fn scout(
315
let config = config.and_then(|c| c.0.clone().take()).unwrap_or_default();
316
let scout = zenoh::scout(what, config).with(callback).res_sync();
317
match scout {
318
- Ok(scout) => Ok(_Scout(scout)),
+ Ok(scout) => Ok(_Scout(Some(scout))),
319
Err(e) => Err(e.to_pyerr()),
320
321
322
+
323
+impl Drop for _Scout {
324
+ fn drop(&mut self) {
325
+ Python::with_gil(|gil| gil.allow_threads(|| drop(self.0.take())));
326
+ }
327
+}
0 commit comments