# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1326816647 0 # Node ID bc3a11fe9a4633709d560e6b34706ef14917b98d # Parent 9c5d3ac5bec51ea7d4f2a7414d6f5833be78ec98 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. diff -r 9c5d3ac5bec5 -r bc3a11fe9a46 dwtest.c --- 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; } diff -r 9c5d3ac5bec5 -r bc3a11fe9a46 mac/dw.m --- 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 + * (C) 2011-2012 Brian Smith * (C) 2011 Mark Hessling * * 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); }