mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Use zeroing weak reference to NSWindow instance (10.8)
This commit is contained in:
@@ -19,7 +19,7 @@ OAK_DEBUG_VAR(OakToolTip);
|
||||
- (void)showAtLocation:(NSPoint)aPoint forScreen:(NSScreen*)aScreen;
|
||||
@end
|
||||
|
||||
static __unsafe_unretained OakToolTip* LastToolTip;
|
||||
static __weak OakToolTip* LastToolTip;
|
||||
|
||||
@implementation OakToolTip
|
||||
+ (void)initialize
|
||||
@@ -62,12 +62,6 @@ static __unsafe_unretained OakToolTip* LastToolTip;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
D(DBF_OakToolTip, bug("\n"););
|
||||
LastToolTip = nil;
|
||||
}
|
||||
|
||||
- (void)setFont:(NSFont*)aFont
|
||||
{
|
||||
ASSERT(aFont != nil);
|
||||
@@ -221,9 +215,7 @@ void OakShowToolTip (NSString* msg, NSPoint location)
|
||||
}
|
||||
|
||||
[toolTip showAtLocation:location forScreen:screen];
|
||||
|
||||
if(OakToolTip* lastToolTip = LastToolTip)
|
||||
[lastToolTip performSelector:@selector(orderOut:) withObject:nil afterDelay:0];
|
||||
[LastToolTip performSelector:@selector(orderOut:) withObject:nil afterDelay:0];
|
||||
LastToolTip = toolTip;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user