Skip to content

Commit

Permalink
Should fix issue #44
Browse files Browse the repository at this point in the history
Should prevent crashes reported at #44
  • Loading branch information
barijaona committed May 1, 2012
1 parent 5a0661e commit 49b2886
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Database.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#import "ArticleRef.h"
#import "SearchString.h"
#import "NSNotificationAdditions.h"
#import "RefreshManager.h"

// Private scope flags
#define MA_Scope_Inclusive 1
Expand Down Expand Up @@ -2295,6 +2296,7 @@ -(NSArray *)arrayOfArticles:(NSInteger)folderId filterString:(NSString *)filterS
queryString = [NSString stringWithFormat:@"select * from messages where (%@)%@", [self criteriaToSQL:tree], filterClause];
}

[[RefreshManager articlesUpdateSemaphore] lock];
// Verify we're on the right thread
[self verifyThreadSafety];

Expand Down Expand Up @@ -2351,6 +2353,7 @@ -(NSArray *)arrayOfArticles:(NSInteger)folderId filterString:(NSString *)filterS

// Deallocate
[results release];
[[RefreshManager articlesUpdateSemaphore] unlock];
return newArray;
}

Expand Down

0 comments on commit 49b2886

Please sign in to comment.