aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/QuartzTextStyle.h
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2012-06-12 21:57:54 +1000
committernyamatongwe <nyamatongwe@gmail.com>2012-06-12 21:57:54 +1000
commit10d83e306ced24841f377ee78c16ff4d4e4991ac (patch)
tree7f6bbae27dfd805e1183f16458a4c9393e4a96c6 /cocoa/QuartzTextStyle.h
parent5b5a166d9595fc6c32639e88e4dbca4f4e7c10a8 (diff)
downloadscintilla-mirror-10d83e306ced24841f377ee78c16ff4d4e4991ac.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.h12
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)