Skip to content

Commit

Permalink
Merge pull request gali8#168 from ws233/master
Browse files Browse the repository at this point in the history
Protect against initialize being called many times.
  • Loading branch information
Kevin Conley committed Apr 22, 2015
2 parents ed0a966 + 6e90884 commit 2cea0da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions TesseractOCR/G8Tesseract.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ + (void)initialize {

[super initialize];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveMemoryWarningNotification:)
name:UIApplicationDidReceiveMemoryWarningNotification
object:nil];
if (self == [G8Tesseract self]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveMemoryWarningNotification:)
name:UIApplicationDidReceiveMemoryWarningNotification
object:nil];
}
}

+ (void)didReceiveMemoryWarningNotification:(NSNotification*)notification {
Expand Down

0 comments on commit 2cea0da

Please sign in to comment.