From 79a522efb3e53e1f4390f18378e4d255998c7ef9 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 14 May 2016 21:29:44 -0400 Subject: [PATCH] More TODO resolution. Thanks to someone (mikeash?) in irc.freenode.org/#macdev. --- darwin/fontbutton.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/darwin/fontbutton.m b/darwin/fontbutton.m index 3a61c823..ac3561fa 100644 --- a/darwin/fontbutton.m +++ b/darwin/fontbutton.m @@ -123,10 +123,10 @@ struct uiFontButton { fm = (NSFontManager *) sender; old = self->libui_font; self->libui_font = [sender convertFont:self->libui_font]; - // TODO do we get it back retained? - // TODO is it even retained when we get it, regardless of value? - if (self->libui_font != old) - [old release]; + // do this even if it returns the same; we don't own anything that isn't from a new or alloc/init + [self->libui_font retain]; + // do this second just in case + [old release]; [self updateFontButtonLabel]; (*(b->onChanged))(b, b->onChangedData); }