diff --git a/ChangeLog b/ChangeLog index 32ac10ad..e0d89429 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-05-27 03:15-EDT Gregory John Casamento + + * 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 * GormObjCHeaderParser/OCIVarDecl.m diff --git a/GormCore/GormDocument.m b/GormCore/GormDocument.m index 8de3d8b9..ff408157 100644 --- a/GormCore/GormDocument.m +++ b/GormCore/GormDocument.m @@ -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); } }