bug-gnustep
[Top][All Lists]
Advanced

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

Fix, NSPrintOperation


From: Georg Fleischmann
Subject: Fix, NSPrintOperation
Date: Mon, 13 May 2002 21:17:16 GMT

Hi,

here is a patch for [NSPrintOperation (GSEPSPrintOperation) -createContext:].
I fixed the problem before (in a different way), but it's now back again.

The problem is, that GSStreamContext doesn't close it's file stream before the  
application has returned to the runloop, but the contents of the file is  
needed earlier in deliverResults.
The patch adds a local AutoreleasePool for the EPS context to get rid of the  
autorelease.

Georg


2002-05-13  Georg Fleischmann

        * gui/Source/NSPrintOperation.m
        [NSPrintOperation(GSEPSPrintOperation) -createContext:]:
        add local autorelease pool to remove autorelease of context


*** gui/Source/NSPrintOperation.m.old   Fri Apr 12 23:06:51 2002
--- gui/Source/NSPrintOperation.m       Mon May 13 23:08:48 2002
***************
*** 1212,1217 ****
--- 1212,1218 ----
  - (NSGraphicsContext*)createContext
  {
    NSMutableDictionary *info;
+   NSAutoreleasePool   *pool;
    if (_context)
      return _context;

***************
*** 1220,1226 ****
--- 1221,1231 ----
    [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;
  }



reply via email to

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