sendEvent: can cause the window to be destroyed

This commit is contained in:
Robert Grant 2013-10-04 18:17:03 -04:00
parent 08af95f905
commit 8dfbdbf226

View File

@ -2091,6 +2091,10 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
-(void)sendEvent:(NSEvent *)event {
// Some events can cause our window to be destroyed
// So make sure self lives at least through this current run loop...
[[self retain] autorelease];
if (_sheetContext != nil) {
NSView *view = [_backgroundView hitTest:[event locationInWindow]];