Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Misc fixes

  • Loading branch information...
commit 9aec18fe31a7b907244e8c96d99a86278f4a71e2 1 parent e0396cb
Matt Ronge mronge authored
12 Source/CTCoreFolder.m
View
@@ -135,6 +135,7 @@ - (BOOL)setPath:(NSString *)path; {
- (CTIdleResult)idleWithTimeout:(NSUInteger)timeout {
NSAssert(!self.idling, @"Can't call idle when we are already idling!");
+ self.lastError = nil;
BOOL success = [self connect];
if (!success) {
@@ -145,7 +146,10 @@ - (CTIdleResult)idleWithTimeout:(NSUInteger)timeout {
int r = 0;
self.idling = YES;
- pipe(idlePipe);
+ r = pipe(idlePipe);
+ if (r == -1) {
+ return CTIdleError;
+ }
self.imapSession->imap_selection_info->sel_exists = 0;
r = mailimap_idle(self.imapSession);
@@ -197,13 +201,13 @@ - (CTIdleResult)idleWithTimeout:(NSUInteger)timeout {
self.lastError = MailCoreCreateErrorFromIMAPCode(r);
result = CTIdleError;
}
-
+
+ self.idling = NO;
close(idlePipe[1]);
close(idlePipe[0]);
idlePipe[1] = -1;
idlePipe[0] = -1;
- self.idling = NO;
-
+
return result;
}
2  Source/CTCoreMessage.m
View
@@ -47,7 +47,7 @@ @implementation CTCoreMessage
@synthesize mime=myParsedMIME, lastError, parentFolder;
- (id)init {
- [super init];
+ self = [super init];
if (self) {
struct mailimf_fields *fields = mailimf_fields_new_empty();
myFields = mailimf_single_fields_new(fields);
2  Source/MailCoreUtilities.m
View
@@ -77,7 +77,7 @@ void MailCoreDisableLogging() {
default: {
const char *errStr = mailsmtp_strerror(errcode);
if (errStr) {
- description = [[NSString alloc] initWithCString:errStr encoding:NSUTF8StringEncoding];
+ description = [[[NSString alloc] initWithCString:errStr encoding:NSUTF8StringEncoding] autorelease];
}
break;
}
Please sign in to comment.
Something went wrong with that request. Please try again.