1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-11-17 09:29:37 +00:00

Still doesn't work, but at least it doesn't segfault now.

This commit is contained in:
Nolan Darilek 2020-08-11 14:44:52 -05:00
parent 753f6c5ecd
commit faadc0e3b7

View File

@ -9,7 +9,7 @@ use objc::*;
use crate::{Backend, Error, Features};
pub struct NSSpeechSynthesizerBackend(*mut Object);
pub struct NSSpeechSynthesizerBackend(*mut Object, *mut Object);
impl NSSpeechSynthesizerBackend {
pub fn new() -> Self {
@ -27,9 +27,9 @@ impl NSSpeechSynthesizerBackend {
)
};
let delegate_class = decl.register();
let delegate_object: Object = unsafe { msg_send![delegate_class, alloc] };
let _: () = unsafe { msg_send![obj, setDelegate: delegate_object] };
NSSpeechSynthesizerBackend(obj)
let delegate_obj: *mut Object = unsafe { msg_send![delegate_class, new] };
let _: () = unsafe { msg_send![obj, setDelegate: delegate_obj] };
NSSpeechSynthesizerBackend(obj, delegate_obj)
}
}