summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qcore_mac.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp
index e0dae37..80cbac9 100644
--- a/src/corelib/kernel/qcore_mac.cpp
+++ b/src/corelib/kernel/qcore_mac.cpp
@@ -74,8 +74,13 @@ CFStringRef QCFString::toCFStringRef(const QString &string)
QCFString::operator CFStringRef() const
{
- if (!type)
- const_cast<QCFString*>(this)->type = toCFStringRef(string);
+ if (!type) {
+ const_cast<QCFString*>(this)->type =
+ CFStringCreateWithCharactersNoCopy(0,
+ reinterpret_cast<const UniChar *>(string.unicode()),
+ string.length(),
+ kCFAllocatorNull);
+ }
return type;
}