From 639bb29ab337fb48397fff9febd452e2dc1b99f5 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 14 May 2019 15:53:42 +0200 Subject: [PATCH] core/refs: fix leak --- nihav-core/src/refs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nihav-core/src/refs.rs b/nihav-core/src/refs.rs index 023a213..4c2e290 100644 --- a/nihav-core/src/refs.rs +++ b/nihav-core/src/refs.rs @@ -83,7 +83,8 @@ impl Drop for NABufferRef { 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); } } } -- 2.39.5