* GormCore/GormDocument.m: Rewrite fix for bug #39072 to stop

leaking memory.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@38052 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-08-31 19:47:45 +00:00
parent abce1603c7
commit 9c9af61d37
2 changed files with 10 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2014-08-31 Fred Kiefer <FredKiefer@gmx.de>
* GormCore/GormDocument.m: Rewrite fix for bug #39072 to stop
leaking memory.
2014-07-21 Fred Kiefer <FredKiefer@gmx.de>
* GormCore/GormImage.m: Fix the init issue for the second
@ -26,7 +31,6 @@
* GormCore/GormInspectorsManager.m
Explicitely cast NSIntegers to avoid warning and problems.
>>>>>>> .r37930
2014-05-27 03:26-EDT Gregory John Casamento <greg.casamento@gmail.com>
* GormCore/GormInspectorsManager.m

View file

@ -2114,13 +2114,12 @@ 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*)someName forObject: (id)object
- (void) setName: (NSString*)aName forObject: (id)object
{
id oldObject = nil;
NSString *oldName = nil;
NSMutableDictionary *cc = [classManager customClassMap];
NSString *className = nil;
NSString *aName = [someName copy];
if (object == nil)
{
@ -2208,16 +2207,15 @@ static void _real_close(GormDocument *self,
// check the custom classes map and replace the appropriate
// object, if a mapping exists.
if(cc != nil)
if (cc != nil)
{
className = [cc objectForKey: oldName];
RETAIN(className);
if(className != nil)
if (className != nil)
{
RETAIN(oldName);
RETAIN(className);
[cc removeObjectForKey: oldName];
[cc setObject: className forKey: aName];
RELEASE(oldName);
RELEASE(className);
}
}