aboutsummaryrefslogtreecommitdiff
path: root/pulse/src
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2021-05-02 19:42:03 +0200
committerAndreas Grois <andi@grois.info>2021-05-02 19:42:03 +0200
commit508a981dc34e7f7f0fbb9aff9c4285fd8bac2998 (patch)
treed84387953967e54d8106c78553bda782f8c36ef8 /pulse/src
parent2664e8443069fb25cd31afdef1e55bc18f052bfe (diff)
Properly quit pulse main function. Not that it'd matter.
All that this cleanup does is set the return value... Apart from that, it's just like nuking the main loop by calling free...
Diffstat (limited to 'pulse/src')
-rw-r--r--pulse/src/runnable/pulse.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/pulse/src/runnable/pulse.rs b/pulse/src/runnable/pulse.rs
index a28c073..86819a9 100644
--- a/pulse/src/runnable/pulse.rs
+++ b/pulse/src/runnable/pulse.rs
@@ -122,7 +122,10 @@ impl PulseMainLoop {
impl Drop for PulseMainLoop {
fn drop(&mut self) {
if !self.main_loop.is_null() {
- unsafe { pa_mainloop_free(self.main_loop); }
+ unsafe {
+ pa_mainloop_quit(self.main_loop, 0);
+ pa_mainloop_free(self.main_loop);
+ }
}
self.main_loop = std::ptr::null_mut();
}
@@ -139,6 +142,7 @@ impl Drop for PulseMainLoop {
extern {
fn pa_mainloop_new() -> *mut PaMainloop;
fn pa_mainloop_wakeup(_ : *mut PaMainloop);
+ fn pa_mainloop_quit(_ : *mut PaMainloop, retval : c_int);
fn pa_mainloop_free(_ : *mut PaMainloop);
fn pa_mainloop_get_api(_ : *mut PaMainloop) -> *mut PaMainloopApi;