From 006346a36c0c12497cd82708d58bb7018ee9e11c Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Mon, 22 Feb 2016 23:19:28 -0800 Subject: Memory usage tweaks --- src/core/imap/MCIMAPSession.cpp | 4 +++- src/core/renderer/MCDateFormatter.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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(); }; } -- cgit v1.2.3