changeset 1559:bc3a11fe9a46

Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool. Just drain the pool during exit. Also switched to using dw_exit() and dw_main_quit() in dwtest.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 17 Jan 2012 16:10:47 +0000
parents 9c5d3ac5bec5
children ee47bda26916
files dwtest.c mac/dw.m
diffstat 2 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/dwtest.c	Tue Jan 17 06:49:05 2012 +0000
+++ b/dwtest.c	Tue Jan 17 16:10:47 2012 +0000
@@ -571,19 +571,13 @@
 
 int DWSIGNAL exit_callback(HWND window, void *data)
 {
-    dw_taskbar_delete(textbox1, fileicon);
-    dw_window_destroy((HWND)data);
-    exit(0);
-    return -1;
-}
-
-int DWSIGNAL test_callback(HWND window, void *data)
-{
-    dw_window_destroy((HWND)data);
-    if ( current_file )
-        dw_free( current_file );
-    exit(0);
-    return -1;
+    if(dw_messagebox("dwtest", DW_MB_YESNO | DW_MB_QUESTION, "Are you sure you want to exit?"))
+    {
+        dw_taskbar_delete(textbox1, fileicon);
+        dw_window_destroy((HWND)data);
+        dw_main_quit();
+    }
+    return TRUE;
 }
 
 int DWSIGNAL browse_file_callback(HWND window, void *data)
@@ -1698,5 +1692,7 @@
 
     dw_main();
 
+    dw_debug("dwtest exiting...");
+    dw_exit(0);
     return 0;
 }
--- a/mac/dw.m	Tue Jan 17 06:49:05 2012 +0000
+++ b/mac/dw.m	Tue Jan 17 16:10:47 2012 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the MacOS GUI using Cocoa
  *
- * (C) 2012 Brian Smith <brian@dbsoft.org>
+ * (C) 2011-2012 Brian Smith <brian@dbsoft.org>
  * (C) 2011 Mark Hessling <mark@rexx.org>
  *
  * Requires 10.5 or later.
@@ -2922,7 +2922,10 @@
  */
 void API dw_exit(int exitcode)
 {
-    _dw_pool_drain();
+#if !defined(GARBAGE_COLLECT)
+    pool = pthread_getspecific(_dw_pool_key);
+    [pool drain];
+#endif
     exit(exitcode);
 }