bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix: NSBezierPath, +bezierPath


From: Georg Fleischmann
Subject: Fix: NSBezierPath, +bezierPath
Date: Sat, 23 Feb 2002 21:07:59 GMT

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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]