git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27741 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-01-31 06:17:29 +00:00
parent 907b7a60e1
commit 52de0f2703
3 changed files with 42 additions and 23 deletions

View file

@ -1,3 +1,8 @@
2009-01-31 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSToolTips.m: Fix retain/release problem.
* Source/NSToolbar.m: Add exception handler round unsafe code.
2009-01-30 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSThemeTools.m: Add checks to prevent problems in the case

View file

@ -73,17 +73,33 @@
}
- (void) dealloc
{
[self setObject: nil];
[super dealloc];
}
- (id) initWithObject: (id)o userData: (void*)d rect: (NSRect)r
{
data = d;
viewRect = r;
[self setObject: o];
return self;
}
- (id) object
{
return object;
}
- (void) setObject: (id)o
{
/* Experimentation on MacOS-X shows that the object is not retained.
* However, if the object does not provide a string, we must use a
* copy of its description ... and we have to retain that until we
* are done with it.
*/
if ([object respondsToSelector:
@selector(view:stringForToolTip:point:userData:)] == NO)
{
/* Object must be a string rather than something which provides one */
RELEASE(object);
}
[super dealloc];
}
- (id) initWithObject: (id)o userData: (void*)d rect: (NSRect)r
{
data = d;
object = o;
if ([object respondsToSelector:
@selector(view:stringForToolTip:point:userData:)] == NO)
@ -93,16 +109,6 @@
*/
object = [[object description] copy];
}
viewRect = r;
return self;
}
- (id) object
{
return object;
}
- (void) setObject: (id)o
{
object = o;
}
- (NSRect) viewRect
{

View file

@ -270,14 +270,22 @@ static GSValidationCenter *vc = nil;
- (void) validate
{
_validating = YES;
// NSLog(@"vobj validate");
[_observers makeObjectsPerformSelector: @selector(_validate:)
withObject: _window];
_validating = NO;
if (_validating == NO)
{
_validating = YES;
NS_DURING
{
[_observers makeObjectsPerformSelector: @selector(_validate:)
withObject: _window];
_validating = NO;
}
NS_HANDLER
{
_validating = NO;
NSLog(@"Problem validating toolbar: %@", localException);
}
NS_ENDHANDLER
}
}
- (void) mouseEntered: (NSEvent *)event