Ensure ‘self’ is kept retained

This shouldn’t be necessary, as we have a ‘retainedSelf’ instance variable that isn’t cleared until ‘[self.window close]’ (the last line of the accept: method), nonetheless I am seeing (rare) crashes from this method, and it appears to be reading the ‘self.window’ property in the last line, so adding this extra safety and will monitor crash reports.
This commit is contained in:
Allan Odgaard
2013-02-06 14:50:03 +01:00
parent 6950ebee9a
commit 3c0e1de557

View File

@@ -238,9 +238,10 @@
- (IBAction)accept:(id)sender
{
[[self window] orderOut:self];
[self sendAction:nil];
[[self window] close];
OakFilterWindowController* retainedSelf = self;
[retainedSelf.window orderOut:self];
[retainedSelf sendAction:nil];
[retainedSelf.window close];
}
- (IBAction)singleClick:(id)sender