From f7edb957d6230b76f8ee6d37e800f096682e8b31 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Tue, 14 May 2002 18:49:00 +0000 Subject: [PATCH] Make sure context is released git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13654 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSPrintOperation.m | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 950c6461d..4912df47f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-05-13 Georg Fleischmann + + * gui/Source/NSPrintOperation.m + [NSPrintOperation(GSEPSPrintOperation) -createContext:]: + add local autorelease pool to remove autorelease of context. + 2002-05-13 Fred Kiefer * Source/NSColor.m diff --git a/Source/NSPrintOperation.m b/Source/NSPrintOperation.m index afea689b8..d110026af 100644 --- a/Source/NSPrintOperation.m +++ b/Source/NSPrintOperation.m @@ -1212,6 +1212,8 @@ scaleRect(NSRect rect, double scale) - (NSGraphicsContext*)createContext { NSMutableDictionary *info; + NSAutoreleasePool *pool; + if (_context) return _context; @@ -1220,7 +1222,11 @@ scaleRect(NSRect rect, double scale) [info setObject: _path forKey: @"NSOutputFile"]; [info setObject: NSGraphicsContextPSFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; + /* We have to remove the autorelease from the context, because we need the + contents of the file before the next return to the run loop */ + pool = [NSAutoreleasePool new]; _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]); + [pool release]; return _context; }