Browse Source

Make device reference counter private again

TODO: check when to increment reference counter or if ever.
fixes
Andreas Linz 5 years ago
parent
commit
0d00794648
2 changed files with 2 additions and 3 deletions
  1. +2
    -2
      src/base.rs
  2. +0
    -1
      src/stream.rs

+ 2
- 2
src/base.rs View File

@ -370,14 +370,14 @@ impl Device {
// ref is a keyword
/// Add 1 to the reference count of `device`.
pub fn inc_ref(&self) {
fn inc_ref(&self) {
unsafe { ffi::soundio_device_ref(self.device) }
}
// Called automatically on `Device` drop.
/// Remove 1 to the reference count of `device`. Clean up if it was the last
/// reference.
pub fn dec_ref(&self) {
fn dec_ref(&self) {
unsafe { ffi::soundio_device_unref(self.device) }
}

+ 0
- 1
src/stream.rs View File

@ -385,7 +385,6 @@ impl<'a> OutStream<'a> {
/// Returns the underlying device of the output stream.
pub fn device(&self) -> Device {
let dev = Device::new(unsafe { (*self.stream).device });
dev.inc_ref();
dev
}

Loading…
Cancel
Save