]> git.nihav.org Git - nihav.git/commitdiff
core/refs: fix leak
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 14 May 2019 13:53:42 +0000 (15:53 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 14 May 2019 13:53:42 +0000 (15:53 +0200)
nihav-core/src/refs.rs

index 023a2136ad99fdafebe5d653957eb372e2f22cae..4c2e2903a0f3e11b4a02a093f93d158398ff6656 100644 (file)
@@ -83,7 +83,8 @@ impl<T> Drop for NABufferRef<T> {
     fn drop(&mut self) {
         unsafe {
             if NABufferData::dec_refs(self.ptr.as_mut().unwrap()) {
-                std::ptr::drop_in_place(self.ptr);
+                let data = Box::from_raw(self.ptr);
+                std::mem::drop(data);
             }
         }
     }