all: fix memory leaks
This commit is contained in:
parent
e212e0b8b1
commit
9904717c71
18 changed files with 149 additions and 10 deletions
11
src/dbus.rs
11
src/dbus.rs
|
|
@ -153,6 +153,11 @@ impl Dbus {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.system.clear();
|
||||
self.session.clear();
|
||||
}
|
||||
|
||||
pub fn system(&self) -> Result<Rc<DbusSocket>, DbusError> {
|
||||
self.system
|
||||
.get(&self.eng, "/var/run/dbus/system_bus_socket", "System bus")
|
||||
|
|
@ -261,6 +266,12 @@ impl DbusHolder {
|
|||
run_toplevel: run_toplevel.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
if let Some(socket) = self.socket.take() {
|
||||
socket.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for DbusHolder {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue