diff options
author | Nicholas Tay <nick@windblume.net> | 2023-07-26 22:21:15 +1000 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2023-07-26 22:21:15 +1000 |
commit | 7d2f0751d0043a4f5ac0c1a6118622202e4e9e47 (patch) | |
tree | 52fea3c33a9ed32eae02e6233aac690ef973fad2 | |
parent | 2565b0e28ff2c58dd3f34624a71c7a2acaac0a0a (diff) | |
download | clak-7d2f0751d0043a4f5ac0c1a6118622202e4e9e47.tar.gz clak-7d2f0751d0043a4f5ac0c1a6118622202e4e9e47.tar.bz2 clak-7d2f0751d0043a4f5ac0c1a6118622202e4e9e47.zip |
I think it's this simple, maybe I got confused by the memory going up a
bit. But I think this actually works, simply releasing should ARC
cleanup, and the memory goes up a bit just because of the NSCache but
doens't go up further.
Again it'd be nicer to use some different lower level way of playing,
but this is definitely good enough for now.
-rw-r--r-- | platform/darwin-native.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/darwin-native.m b/platform/darwin-native.m index 633d04b..07ca714 100644 --- a/platform/darwin-native.m +++ b/platform/darwin-native.m @@ -15,7 +15,6 @@ static NSCache *audio_cache = nil; @implementation ClakMacSound - (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)flag { [sound release]; - [sound dealloc]; } @end static ClakMacSound *clak_mac_sound = nil; @@ -52,6 +51,7 @@ void macos_sound_play(unsigned char *buffer, unsigned int buffer_len) } NSSound *sound = [[NSSound alloc] initWithData:buffer_ns]; + sound.delegate = clak_mac_sound; [sound play]; } |