mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 11:20:58 +00:00
fix for #25385
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27741 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4ac3bb0344
commit
2b18227eb0
3 changed files with 42 additions and 23 deletions
|
@ -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>
|
2009-01-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/GSThemeTools.m: Add checks to prevent problems in the case
|
* Source/GSThemeTools.m: Add checks to prevent problems in the case
|
||||||
|
|
|
@ -73,17 +73,33 @@
|
||||||
}
|
}
|
||||||
- (void) dealloc
|
- (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:
|
if ([object respondsToSelector:
|
||||||
@selector(view:stringForToolTip:point:userData:)] == NO)
|
@selector(view:stringForToolTip:point:userData:)] == NO)
|
||||||
{
|
{
|
||||||
/* Object must be a string rather than something which provides one */
|
/* Object must be a string rather than something which provides one */
|
||||||
RELEASE(object);
|
RELEASE(object);
|
||||||
}
|
}
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
- (id) initWithObject: (id)o userData: (void*)d rect: (NSRect)r
|
|
||||||
{
|
|
||||||
data = d;
|
|
||||||
object = o;
|
object = o;
|
||||||
if ([object respondsToSelector:
|
if ([object respondsToSelector:
|
||||||
@selector(view:stringForToolTip:point:userData:)] == NO)
|
@selector(view:stringForToolTip:point:userData:)] == NO)
|
||||||
|
@ -93,16 +109,6 @@
|
||||||
*/
|
*/
|
||||||
object = [[object description] copy];
|
object = [[object description] copy];
|
||||||
}
|
}
|
||||||
viewRect = r;
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
- (id) object
|
|
||||||
{
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
- (void) setObject: (id)o
|
|
||||||
{
|
|
||||||
object = o;
|
|
||||||
}
|
}
|
||||||
- (NSRect) viewRect
|
- (NSRect) viewRect
|
||||||
{
|
{
|
||||||
|
|
|
@ -270,14 +270,22 @@ static GSValidationCenter *vc = nil;
|
||||||
|
|
||||||
- (void) validate
|
- (void) validate
|
||||||
{
|
{
|
||||||
_validating = YES;
|
if (_validating == NO)
|
||||||
|
{
|
||||||
// NSLog(@"vobj validate");
|
_validating = YES;
|
||||||
|
NS_DURING
|
||||||
[_observers makeObjectsPerformSelector: @selector(_validate:)
|
{
|
||||||
withObject: _window];
|
[_observers makeObjectsPerformSelector: @selector(_validate:)
|
||||||
|
withObject: _window];
|
||||||
_validating = NO;
|
_validating = NO;
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
_validating = NO;
|
||||||
|
NSLog(@"Problem validating toolbar: %@", localException);
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) mouseEntered: (NSEvent *)event
|
- (void) mouseEntered: (NSEvent *)event
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue