aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-02-22 23:19:28 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-02-22 23:19:28 -0800
commit006346a36c0c12497cd82708d58bb7018ee9e11c (patch)
treee692df629bbd2c80a193cb58799bb74800758db3 /src
parentaf0d0dd4f57ee0745bc1910ef35fc7b88bf20613 (diff)
Memory usage tweaks
Diffstat (limited to 'src')
-rwxr-xr-xsrc/core/imap/MCIMAPSession.cpp4
-rw-r--r--src/core/renderer/MCDateFormatter.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp
index 466ff936..9fb80711 100755
--- a/src/core/imap/MCIMAPSession.cpp
+++ b/src/core/imap/MCIMAPSession.cpp
@@ -518,10 +518,12 @@ static void logger(mailimap * imap, int log_type, const char * buffer, size_t si
return;
bool isBuffer = isBufferFromLogType(log_type);
-
+
if (isBuffer) {
+ AutoreleasePool * pool = new AutoreleasePool();
Data * data = Data::dataWithBytes(buffer, (unsigned int) size);
session->connectionLogger()->log(session, type, data);
+ pool->release();
}
else {
session->connectionLogger()->log(session, type, NULL);
diff --git a/src/core/renderer/MCDateFormatter.h b/src/core/renderer/MCDateFormatter.h
index d2198d04..4a789b1d 100644
--- a/src/core/renderer/MCDateFormatter.h
+++ b/src/core/renderer/MCDateFormatter.h
@@ -38,6 +38,8 @@ namespace mailcore {
static DateFormatter * dateFormatter();
+ virtual void prepare();
+
virtual void setDateStyle(DateFormatStyle style);
virtual DateFormatStyle dateStyle();
@@ -55,7 +57,7 @@ namespace mailcore {
virtual String * stringFromDate(time_t date);
virtual time_t dateFromString(String * dateString);
-
+
private:
UDateFormat * mDateFormatter;
DateFormatStyle mDateStyle;
@@ -64,8 +66,6 @@ namespace mailcore {
String * mTimezone;
String * mLocale;
void * mAppleDateFormatter;
-
- void prepare();
};
}