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/QuartzTextStyle.h | |
| 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/QuartzTextStyle.h')
| -rw-r--r-- | cocoa/QuartzTextStyle.h | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/cocoa/QuartzTextStyle.h b/cocoa/QuartzTextStyle.h index 51d03cf91..faffe7616 100644 --- a/cocoa/QuartzTextStyle.h +++ b/cocoa/QuartzTextStyle.h @@ -23,6 +23,18 @@ public:  		characterSet = 0;      } +    QuartzTextStyle(const QuartzTextStyle &other) +    { +	    // Does not copy font colour attribute +	    fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef)); +	    styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, +						  &kCFTypeDictionaryKeyCallBacks,  +						  &kCFTypeDictionaryValueCallBacks); +	    CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); +	    characterSet = other.characterSet; +    } +	 +      ~QuartzTextStyle()      {  		if (styleDict != NULL)  | 
