Author: gcasa
Date: Tue May 27 09:17:37 2014
New Revision: 37911

URL: http://svn.gna.org/viewcvs/gnustep?rev=37911&view=rev
Log:
Fix bug #39072

Modified:
    apps/gorm/trunk/ChangeLog
    apps/gorm/trunk/GormCore/GormDocument.m

Modified: apps/gorm/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/ChangeLog?rev=37911&r1=37910&r2=37911&view=diff
==============================================================================
--- apps/gorm/trunk/ChangeLog   (original)
+++ apps/gorm/trunk/ChangeLog   Tue May 27 09:17:37 2014
@@ -1,3 +1,8 @@
+2014-05-27 03:15-EDT Gregory John Casamento <[email protected]>
+
+       * 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 <[email protected]>
 
        * GormObjCHeaderParser/OCIVarDecl.m

Modified: apps/gorm/trunk/GormCore/GormDocument.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormCore/GormDocument.m?rev=37911&r1=37910&r2=37911&view=diff
==============================================================================
--- apps/gorm/trunk/GormCore/GormDocument.m     (original)
+++ apps/gorm/trunk/GormCore/GormDocument.m     Tue May 27 09:17:37 2014
@@ -2113,12 +2113,13 @@
  * 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 @@
   if(cc != nil)
     {
       className = [cc objectForKey: oldName];
+      RETAIN(className);
       if(className != nil)
        {
+         RETAIN(oldName);
          [cc removeObjectForKey: oldName];
          [cc setObject: className forKey: aName]; 
+         RELEASE(oldName);
        }
     }
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to