diff options
-rw-r--r-- | src/core/smtp/MCSMTPSession.cpp | 2 | ||||
-rwxr-xr-x | src/objc/imap/MCOIMAPSession.mm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | src/objc/smtp/MCOSMTPSession.mm | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/core/smtp/MCSMTPSession.cpp b/src/core/smtp/MCSMTPSession.cpp index 166a58cd..758f5c65 100644 --- a/src/core/smtp/MCSMTPSession.cpp +++ b/src/core/smtp/MCSMTPSession.cpp @@ -230,8 +230,10 @@ static void logger(mailsmtp * smtp, int log_type, const char * buffer, size_t si bool isBuffer = isBufferFromLogType(log_type); if (isBuffer) { + AutoreleasePool * pool = new AutoreleasePool(); Data * data = Data::dataWithBytes(buffer, (unsigned int) size); session->connectionLoggerNoLock()->log(session, type, data); + pool->release(); } else { session->connectionLoggerNoLock()->log(session, type, NULL); diff --git a/src/objc/imap/MCOIMAPSession.mm b/src/objc/imap/MCOIMAPSession.mm index bec998c8..2eba5cc0 100755 --- a/src/objc/imap/MCOIMAPSession.mm +++ b/src/objc/imap/MCOIMAPSession.mm @@ -42,7 +42,9 @@ public: virtual void log(void * sender, ConnectionLogType logType, Data * data) { - [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; + @autoreleasepool { + [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; + } } virtual void queueStartRunning() diff --git a/src/objc/smtp/MCOSMTPSession.mm b/src/objc/smtp/MCOSMTPSession.mm index 9406a719..04e3993b 100644..100755 --- a/src/objc/smtp/MCOSMTPSession.mm +++ b/src/objc/smtp/MCOSMTPSession.mm @@ -38,7 +38,9 @@ public: virtual void log(void * sender, ConnectionLogType logType, Data * data) { - [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; + @autoreleasepool { + [mSession _logWithSender:sender connectionType:(MCOConnectionLogType)logType data:MCO_TO_OBJC(data)]; + } } virtual void queueStartRunning() |