From 427ca027be92539ade6e34531cb5118cf06bd1ce Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 12 Aug 2020 09:52:16 -0500 Subject: [PATCH] Add `Drop` implementation. --- src/backends/ns_speech_synthesizer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backends/ns_speech_synthesizer.rs b/src/backends/ns_speech_synthesizer.rs index 946d3d6..09999e0 100644 --- a/src/backends/ns_speech_synthesizer.rs +++ b/src/backends/ns_speech_synthesizer.rs @@ -132,3 +132,12 @@ impl Backend for NSSpeechSynthesizerBackend { unimplemented!() } } + +impl Drop for NSSpeechSynthesizerBackend { + fn drop(&mut self) { + unsafe { + let _: Object = msg_send!(self.0, release); + let _: Object = msg_send!(self.1, release); + } + } +}