git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@37911 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2014-05-27 07:17:37 +00:00
parent 3323b82516
commit 3b78ac2018
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2014-05-27 03:15-EDT Gregory John Casamento <greg.casamento@gmail.com>
* GormCore/GormDocument.m: Fix bug #39072: add retain to prevent
segmentation fault when renaming object in document view.
2014-05-26 19:25-EDT Gregory John Casamento <greg.casamento@gmail.com>
* GormObjCHeaderParser/OCIVarDecl.m

View file

@ -2113,12 +2113,13 @@ static void _real_close(GormDocument *self,
* Set aName for object in the document. If aName is nil,
* a name is automatically created for object.
*/
- (void) setName: (NSString*)aName forObject: (id)object
- (void) setName: (NSString*)someName forObject: (id)object
{
id oldObject = nil;
NSString *oldName = nil;
NSMutableDictionary *cc = [classManager customClassMap];
NSString *className = nil;
NSString *aName = [someName copy];
if (object == nil)
{
@ -2209,10 +2210,13 @@ static void _real_close(GormDocument *self,
if(cc != nil)
{
className = [cc objectForKey: oldName];
RETAIN(className);
if(className != nil)
{
RETAIN(oldName);
[cc removeObjectForKey: oldName];
[cc setObject: className forKey: aName];
RELEASE(oldName);
}
}