diff options
| author | nyamatongwe <nyamatongwe@gmail.com> | 2012-06-12 21:57:54 +1000 |
|---|---|---|
| committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-06-12 21:57:54 +1000 |
| commit | 7fd6539ca25bdeaec066f7c25b488b6d96a36a74 (patch) | |
| tree | 2f48eb82f9c65195b0f2db5a0d8bb376cbf960b6 /cocoa/PlatCocoa.mm | |
| parent | 0846de2a587ced6c09ab34b6021bd3969b29e49f (diff) | |
| download | scintilla-mirror-7fd6539ca25bdeaec066f7c25b488b6d96a36a74.tar.gz | |
Fix double free of font objects with list box by copying font.
Diffstat (limited to 'cocoa/PlatCocoa.mm')
| -rw-r--r-- | cocoa/PlatCocoa.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 5c1213d72..fc7d7c222 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1604,10 +1604,11 @@ void ListBoxImpl::Create(Window& /*parent*/, int /*ctrlID*/, Scintilla::Point pt void ListBoxImpl::SetFont(Font& font_) { - font.SetID(font_.GetID()); // NSCell setFont takes an NSFont* rather than a CTFontRef but they // are the same thing toll-free bridged. QuartzTextStyle* style = reinterpret_cast<QuartzTextStyle*>(font_.GetID()); + font.Release(); + font.SetID(new QuartzTextStyle(*style)); NSFont *pfont = (NSFont *)style->getFontRef(); [[colText dataCell] setFont: pfont]; CGFloat itemHeight = lround([pfont ascender] - [pfont descender]); |
