Corrected a segfault and prevent calling designated initializer when loading into interface buidler app.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17562 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2003-08-28 04:38:22 +00:00
parent 6476e59070
commit b865d283b8
2 changed files with 43 additions and 14 deletions

View file

@ -1,3 +1,9 @@
2003-08-28 Gregory John Casamento <greg_casamento@yahoo.com>
* GSNibTemplates.m: Removed an extra release which was causing
a segfault. Added code to prevent calling the designated initializer
when isInterfaceBuilder is defined.
2003-08-27 Adam Fedor <fedor@gnu.org> 2003-08-27 Adam Fedor <fedor@gnu.org>
* Tools/gsnd/gsnd.m (main): Set daemon flag when forking. * Tools/gsnd/gsnd.m (main): Set daemon flag when forking.

View file

@ -415,11 +415,13 @@ static const int currentVersion = 1; // GSNibItem version number...
return _className; return _className;
} }
/*
- (void) dealloc - (void) dealloc
{ {
RELEASE(_className); RELEASE(_className);
[super dealloc]; [super dealloc];
} }
*/
- (id) initWithCoder: (NSCoder *)coder - (id) initWithCoder: (NSCoder *)coder
{ {
@ -519,8 +521,8 @@ static const int currentVersion = 1; // GSNibItem version number...
// set the content view back // set the content view back
[obj setContentView: contentView]; [obj setContentView: contentView];
// RELEASE(self);
} }
RELEASE(self);
} }
return obj; return obj;
} }
@ -546,8 +548,11 @@ static const int currentVersion = 1; // GSNibItem version number...
id obj = [super initWithCoder: coder]; id obj = [super initWithCoder: coder];
if(obj != nil) if(obj != nil)
{ {
NSRect theFrame = [obj frame]; if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
obj = [obj initWithFrame: theFrame]; {
NSRect theFrame = [obj frame];
obj = [obj initWithFrame: theFrame];
}
RELEASE(self); RELEASE(self);
} }
return obj; return obj;
@ -569,8 +574,11 @@ static const int currentVersion = 1; // GSNibItem version number...
id obj = [super initWithCoder: coder]; id obj = [super initWithCoder: coder];
if(obj != nil) if(obj != nil)
{ {
NSRect theFrame = [obj frame]; if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
obj = [obj initWithFrame: theFrame]; {
NSRect theFrame = [obj frame];
obj = [obj initWithFrame: theFrame];
}
RELEASE(self); RELEASE(self);
} }
return obj; return obj;
@ -592,10 +600,13 @@ static const int currentVersion = 1; // GSNibItem version number...
id obj = [super initWithCoder: coder]; id obj = [super initWithCoder: coder];
if(obj != nil) if(obj != nil)
{ {
NSRect theFrame = [obj frame]; if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
id textContainer = [obj textContainer]; {
obj = [obj initWithFrame: theFrame NSRect theFrame = [obj frame];
textContainer: textContainer]; id textContainer = [obj textContainer];
obj = [obj initWithFrame: theFrame
textContainer: textContainer];
}
RELEASE(self); RELEASE(self);
} }
return obj; return obj;
@ -617,8 +628,11 @@ static const int currentVersion = 1; // GSNibItem version number...
id obj = [super initWithCoder: coder]; id obj = [super initWithCoder: coder];
if(obj != nil) if(obj != nil)
{ {
NSString *theTitle = [obj title]; if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
obj = [obj initWithTitle: theTitle]; {
NSString *theTitle = [obj title];
obj = [obj initWithTitle: theTitle];
}
RELEASE(self); RELEASE(self);
} }
return obj; return obj;
@ -641,8 +655,14 @@ static const int currentVersion = 1; // GSNibItem version number...
id obj = [super initWithCoder: coder]; id obj = [super initWithCoder: coder];
if(obj != nil) if(obj != nil)
{ {
// NSRect theFrame = [obj frame]; if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
// obj = [obj initWithFrame: theFrame]; {
//if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
//{
// NSRect theFrame = [obj frame];
// obj = [obj initWithFrame: theFrame];
//}
}
RELEASE(self); RELEASE(self);
} }
return obj; return obj;
@ -663,7 +683,10 @@ static const int currentVersion = 1; // GSNibItem version number...
id obj = [super initWithCoder: coder]; id obj = [super initWithCoder: coder];
if(obj != nil) if(obj != nil)
{ {
// obj = [self init]; //if(![self respondsToSelector: @selector(isInInterfaceBuilder)])
//{
// obj = [self init];
//}
RELEASE(self); RELEASE(self);
} }
return obj; return obj;