Skip to content

Bus: Add BusWatchGuard to automatically remove watch

Johan Sternerup requested to merge johast/gstreamer-rs:bus_watch into main

Previously, with add_watch()/add_watch_local() you had to remember calling remove_watch() in order not to leak the bus, the watch source and two associated file descriptors. Now these methods instead returns an object of type BusWatchGuard that will automatically remove the bus watch when the object is dropped.

Edited by Johan Sternerup

Merge request reports