From 3ec0d578630e142a26150cf7c2c9e07d362eb2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Sat, 20 Jan 2018 16:38:58 +0100 Subject: [PATCH] Convert CFMutableDictionary to use declare_TCFType --- core-foundation/src/dictionary.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core-foundation/src/dictionary.rs b/core-foundation/src/dictionary.rs index c4c2f7c..ba5fc67 100644 --- a/core-foundation/src/dictionary.rs +++ b/core-foundation/src/dictionary.rs @@ -121,15 +121,9 @@ impl CFDictionary { } } -/// An mutable dictionary of key-value pairs. -pub struct CFMutableDictionary(CFMutableDictionaryRef); - -impl Drop for CFMutableDictionary { - fn drop(&mut self) { - unsafe { - CFRelease(self.as_CFTypeRef()) - } - } +declare_TCFType!{ + /// An mutable dictionary of key-value pairs. + CFMutableDictionary, CFMutableDictionaryRef } impl_TCFType!(CFMutableDictionary, CFMutableDictionaryRef, CFDictionaryGetTypeID);