Hi,

here are two little patches for a memory leak in NSBezierPath.
I think +bezierPath should return an autoreleased object (Mac OS X does).
To make this change work, the shared path in XGGState needs a retain.

Georg


2002-02-23  Georg Fleischmann

        * gui/Source/NSBezierPath.m
        [NSBezierPath +bezierPath]: return autoreleased object
        * xgps/Source/XGGState.m
        retain shared path


--- gui/Source/NSBezierPath.m.old       Tue Feb 12 19:01:16 2002
+++ gui/Source/NSBezierPath.m   Sat Feb 23 21:12:00 2002
@@ -94,7 +94,7 @@

 + (id)bezierPath
 {
-  return [[NSBezierPath_concrete_class alloc] init];
+  return AUTORELEASE([[NSBezierPath_concrete_class alloc] init]);
 }

 + (NSBezierPath *)bezierPathWithRect:(NSRect)aRect



--- xgps/Source/XGGState.m.old  Tue Feb 12 19:01:42 2002
+++ xgps/Source/XGGState.m      Sat Feb 23 21:49:50 2002
@@ -55,7 +55,7 @@
 #define CHECK_PATH \
   if (!path) \
     { \
-      path = [NSBezierPath bezierPath]; \
+      path = RETAIN([NSBezierPath bezierPath]); \
     }

 // How could we test if there is a current point?

_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to