mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 19:27:40 +00:00
Make sure context is released
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13654 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b61f4db419
commit
f7edb957d6
2 changed files with 12 additions and 0 deletions
|
@ -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 <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSColor.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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue