comparison 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
comparison
equal deleted inserted replaced
1860:02a23143334c 1861:c836603d3f14
11834 return (DWTID)_threadid; 11834 return (DWTID)_threadid;
11835 } 11835 }
11836 11836
11837 /* 11837 /*
11838 * Cleanly terminates a DW session, should be signal handler safe. 11838 * Cleanly terminates a DW session, should be signal handler safe.
11839 * Parameters: 11839 */
11840 * exitcode: Exit code reported to the operating system. 11840 void API dw_shutdown(void)
11841 */
11842 void API dw_exit(int exitcode)
11843 { 11841 {
11844 /* Destroy the menu message window */ 11842 /* Destroy the menu message window */
11845 dw_window_destroy(hwndApp); 11843 dw_window_destroy(hwndApp);
11846 11844
11847 /* In case we are in a signal handler, don't 11845 /* In case we are in a signal handler, don't
11850 */ 11848 */
11851 Root = NULL; 11849 Root = NULL;
11852 11850
11853 /* Deinit the GBM */ 11851 /* Deinit the GBM */
11854 if(_gbm_deinit) 11852 if(_gbm_deinit)
11853 {
11855 _gbm_deinit(); 11854 _gbm_deinit();
11855 _gbm_deinit = NULL;
11856 }
11856 11857
11857 #ifdef UNICODE 11858 #ifdef UNICODE
11858 /* Free the conversion object */ 11859 /* Free the conversion object */
11859 UniFreeUconvObject(Uconv); 11860 UniFreeUconvObject(Uconv);
11860 /* Deregister the Unicode clipboard format */ 11861 /* Deregister the Unicode clipboard format */
11868 /* Free any in use modules */ 11869 /* Free any in use modules */
11869 DosFreeModule(wpconfig); 11870 DosFreeModule(wpconfig);
11870 DosFreeModule(pmprintf); 11871 DosFreeModule(pmprintf);
11871 DosFreeModule(pmmerge); 11872 DosFreeModule(pmmerge);
11872 DosFreeModule(gbm); 11873 DosFreeModule(gbm);
11873 11874 }
11875
11876 /*
11877 * Cleanly terminates a DW session, should be signal handler safe.
11878 * Parameters:
11879 * exitcode: Exit code reported to the operating system.
11880 */
11881 void API dw_exit(int exitcode)
11882 {
11883 dw_shutdown();
11874 /* And finally exit */ 11884 /* And finally exit */
11875 exit(exitcode); 11885 exit(exitcode);
11876 } 11886 }
11877 11887
11878 /* 11888 /*