[gs-cvs] rev 7857 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Mon Apr 16 17:02:11 PDT 2007
Author: leonardo
Date: 2007-04-16 17:02:10 -0700 (Mon, 16 Apr 2007)
New Revision: 7857
Modified:
trunk/gs/src/gsdevice.c
Log:
Fix : gs_copydevice2 crashed on error.
DETAILS :
This problem has been occasionally detected while working on large patterns.
If an error happens in finish_copydevice, the function gs_copydevices
first closes the device copy, then releases its stype.
However a device usually provides a finalization method,
which releases stype automatically. Thus it has been released twice,
causing a crash in gs_free_object.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/src/gsdevice.c
===================================================================
--- trunk/gs/src/gsdevice.c 2007-04-16 23:55:59 UTC (rev 7856)
+++ trunk/gs/src/gsdevice.c 2007-04-17 00:02:10 UTC (rev 7857)
@@ -291,8 +291,11 @@
code = dev_proc(new_dev, finish_copydevice)(new_dev, dev);
if (code < 0) {
gs_free_object(mem, new_dev, "gs_copydevice(device)");
+#if 0 /* gs_free_object above calls gx_device_finalize,
+ which closes the device and releaszes its stype, i.e. a_std. */
if (a_std)
gs_free_object(dev->memory->non_gc_memory, a_std, "gs_copydevice(stype)");
+#endif
return code;
}
*pnew_dev = new_dev;
More information about the gs-cvs
mailing list