mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Fixed potential font memory issue
The font was not retained when setting gui.norm_font leading to a pointer into freed memory. The font instance is now retained before its pointer value is stored in gui.norm_font.
This commit is contained in:
@@ -851,7 +851,7 @@ gui_mch_init_font(char_u *font_name, int fontset)
|
||||
NSFont *font = gui_macvim_font_with_name(font_name);
|
||||
if (font) {
|
||||
[(NSFont*)gui.norm_font release];
|
||||
gui.norm_font = (GuiFont)font;
|
||||
gui.norm_font = (GuiFont)[font retain];
|
||||
|
||||
// NOTE: MacVim keeps separate track of the normal and wide fonts.
|
||||
// Unless the user changes 'guifontwide' manually, they are based on
|
||||
|
||||
Reference in New Issue
Block a user