[gs-cvs] rev 7111 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Tue Oct 17 06:33:04 PDT 2006


Author: leonardo
Date: 2006-10-17 06:33:02 -0700 (Tue, 17 Oct 2006)
New Revision: 7111

Modified:
   trunk/gs/src/imain.c
Log:
Fix (gs_main_finit) : Provide a right finalization for the language switch project.

DETAILS :

It needs to finalize 
without closing the output device
and without closing the graphics library and files,
because other interpreters may work with them
after the Postscript interpreter closes.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/imain.c
===================================================================
--- trunk/gs/src/imain.c	2006-10-16 15:30:51 UTC (rev 7110)
+++ trunk/gs/src/imain.c	2006-10-17 13:33:02 UTC (rev 7111)
@@ -758,6 +758,7 @@
 	    }
 	    i_ctx_p = minst->i_ctx_p; /* interp_reclaim could change it. */
 	}
+#ifndef PSI_INCLUDED
 	if (i_ctx_p->pgs != NULL && i_ctx_p->pgs->device != NULL) {
 	    gx_device *pdev = i_ctx_p->pgs->device;
 
@@ -777,6 +778,7 @@
 	    if (exit_status == 0 || exit_status == e_Quit)
 		exit_status = code;
 	}
+#endif
     }
     /* Flush stdout and stderr */
     if (minst->init_done >= 2)
@@ -797,6 +799,7 @@
 	    eprintf1("ERROR %d while the final restore. See gs/src/ierrors.h for code explanation.\n", code);
         i_plugin_finit(mem_raw, h);
     }
+#ifndef PSI_INCLUDED
     /* clean up redirected stdout */
     if (minst->heap->gs_lib_ctx->fstdout2 
 	&& (minst->heap->gs_lib_ctx->fstdout2 != minst->heap->gs_lib_ctx->fstdout)
@@ -804,6 +807,7 @@
 	fclose(minst->heap->gs_lib_ctx->fstdout2);
 	minst->heap->gs_lib_ctx->fstdout2 = (FILE *)NULL;
     }
+#endif
     minst->heap->gs_lib_ctx->stdout_is_redirected = 0;
     minst->heap->gs_lib_ctx->stdout_to_stderr = 0;
     /* remove any temporary files, after ghostscript has closed files */
@@ -815,7 +819,9 @@
 	}
 	free(tempnames);
     }
+#ifndef PSI_INCLUDED
     gs_lib_finit(exit_status, code, minst->heap);
+#endif
     return exit_status;
 }
 int



More information about the gs-cvs mailing list