diff os2/dw.c @ 1861:c836603d3f14

Add dw_shutdown() function which does the same thing as dw_exit() ... except it doesn't actually end the process. Useful for bindings that are expecting to do their own cleanup after the script exits.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 01 Mar 2013 16:51:08 +0000
parents 4790589f52a9
children 8a205b80617e
line wrap: on
line diff
--- a/os2/dw.c	Fri Mar 01 13:01:59 2013 +0000
+++ b/os2/dw.c	Fri Mar 01 16:51:08 2013 +0000
@@ -11836,10 +11836,8 @@
 
 /*
  * Cleanly terminates a DW session, should be signal handler safe.
- * Parameters:
- *       exitcode: Exit code reported to the operating system.
- */
-void API dw_exit(int exitcode)
+ */
+void API dw_shutdown(void)
 {
    /* Destroy the menu message window */
    dw_window_destroy(hwndApp);
@@ -11852,7 +11850,10 @@
 
    /* Deinit the GBM */
    if(_gbm_deinit)
+   {
        _gbm_deinit();
+       _gbm_deinit = NULL;
+   }
 
 #ifdef UNICODE
    /* Free the conversion object */
@@ -11870,7 +11871,16 @@
    DosFreeModule(pmprintf);
    DosFreeModule(pmmerge);
    DosFreeModule(gbm);
-   
+}
+
+/*
+ * Cleanly terminates a DW session, should be signal handler safe.
+ * Parameters:
+ *       exitcode: Exit code reported to the operating system.
+ */
+void API dw_exit(int exitcode)
+{
+   dw_shutdown();
    /* And finally exit */
    exit(exitcode);
 }