summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorJean-Philippe Proulx <jeanphilippe.proulx@gmail.com>2014-04-30 13:01:36 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-02 07:16:16 +0200
commitd17e48108df864c446892c0a4318b41b30685de6 (patch)
tree2b6b07710ce877f6a0e096c638a17858d9a32ddb /src/corelib/tools
parent8605f44097a986e10c2ddaf4b4eae0b2331d98d1 (diff)
Fix more double release in QTimeZone on Mac
Several objects are released without being retained. This causes double free crash. Task-number: QTBUG-37582 Task-number: QTBUG-35890 Change-Id: Ic64419c22ab555ba77ada1864feaff247798d3ad Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qtimezoneprivate_mac.mm6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/tools/qtimezoneprivate_mac.mm
index 3484ec79ef..7985b78712 100644
--- a/src/corelib/tools/qtimezoneprivate_mac.mm
+++ b/src/corelib/tools/qtimezoneprivate_mac.mm
@@ -142,7 +142,6 @@ QString QMacTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
NSString *macLocaleCode = QCFString::toNSString(locale.name());
NSLocale *macLocale = [[NSLocale alloc] initWithLocaleIdentifier:macLocaleCode];
const QString result = QCFString::toQString([m_nstz localizedName:style locale:macLocale]);
- [macLocaleCode release];
[macLocale release];
return result;
}
@@ -192,7 +191,6 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
data.daylightTimeOffset = [m_nstz daylightSavingTimeOffsetForDate:date];
data.standardTimeOffset = data.offsetFromUtc - data.daylightTimeOffset;
data.abbreviation = QCFString::toQString([m_nstz abbreviationForDate:date]);
- [date release];
return data;
}
@@ -203,8 +201,6 @@ bool QMacTimeZonePrivate::hasTransitions() const
NSDate *epoch = [NSDate dateWithTimeIntervalSince1970:0];
const NSDate *date = [m_nstz nextDaylightSavingTimeTransitionAfterDate:epoch];
const bool result = ([date timeIntervalSince1970] > [epoch timeIntervalSince1970]);
- [epoch release];
- [date release];
return result;
}
@@ -224,7 +220,6 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
tran.daylightTimeOffset = [m_nstz daylightSavingTimeOffsetForDate:nextDate];
tran.standardTimeOffset = tran.offsetFromUtc - tran.daylightTimeOffset;
tran.abbreviation = QCFString::toQString([m_nstz abbreviationForDate:nextDate]);
- [nextDate release];
return tran;
}
@@ -246,7 +241,6 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::previousTransition(qint64 beforeMSec
nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate];
nextSecs = [nextDate timeIntervalSince1970];
}
- [nextDate release];
}
if (secsList.size() >= 1)
return data(qint64(secsList.last()) * 1000);