More TODO resolution. Thanks to someone (mikeash?) in irc.freenode.org/#macdev.

This commit is contained in:
Pietro Gagliardi 2016-05-14 21:29:44 -04:00
parent 232839020f
commit 79a522efb3
1 changed files with 4 additions and 4 deletions

View File

@ -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);
}