bug-gnustep
[Top][All Lists]
Advanced

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

Re: PSclip


From: Alexander Malmberg
Subject: Re: PSclip
Date: Fri, 22 Mar 2002 16:47:33 +0100

Pete French wrote:
> I am seeing consistent memory problems when using a clipping path in
> GNUstep. Sometimes this manifests itself as the clip working properly, but
> then I get a "Warning: free() called on already freed memory" when the code
> exits, but most of the time it manifests itself as a coredump when the
> code actually runs. I havent yet managed to track down the source of the
> proiblem though, as the debugger never seems to give me any useful info
> as to where the memory smash originally occurred.

Seems to me that -_doPath::draw: was calling XIntersectRegion() without
creating the region, thus causing the crash. I've attached a patch that
fixes it. With the patch it works here.

- Alexander Malmberg
Index: XGGState.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/xgps/Source/XGGState.m,v
retrieving revision 1.81
diff -u -r1.81 XGGState.m
--- XGGState.m  21 Mar 2002 18:16:42 -0000      1.81
+++ XGGState.m  22 Mar 2002 15:41:28 -0000
@@ -912,6 +912,7 @@
        region = XPolygonRegion(pts, count, fill_rule);
        if (clipregion)
          {
+           new_region=XCreateRegion();
            XIntersectRegion(clipregion, region, new_region);
            XDestroyRegion(region);
            XDestroyRegion(clipregion);


reply via email to

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