ftp.nice.ch/pub/next/system/patches/PrintLeakPatch.tar.gz#/PrintLeakPatch

README
 

README

AppKit printing memory-leak and fix

When printing, the AppKit leaks a contiguous piece of virtual memory equal in size to the generated PostScript.  The AppKit never references this virtual memory again, so it ends up wasting space in the swap file (not RAM).  Successive printing consumes more and more swapspace until the system runs out and hangs.

The fix consists of one C function, NXFixPrintLeak, which your application must call from a very specific place.  The application must subclass the spoolFile: method in the View that receives the printPSCode: method (the view that's told to print).  You should override the spoolfile: method as follows:

- spoolFile:(const char *)filename
{
    id ret;

    ret = [super spoolFile:filename];
    NXFixPrintLeak();
    return ret;
}


Finally, you must link the file printLeakPatch.o (containing the NXFixPrintLeak code) into your application.  Create a file called Makefile.preamble containing the following line:

	OTHER_OFILES = printLeakPatch.o

Place printLeakPatch.o in your project directory.  When you "make" your application, this file will get linked into the executable.


These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.