Mercurial > dwindows
diff gtk/dw.c @ 494:edcf9ec12f8c
Fixed a bug in the dialog system on Unix where, gtk_main() could exit
when dw_dialog_wait() and dw_dialog_dismiss() were called from different
threads.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 02 Dec 2003 18:40:27 +0000 |
parents | 84e471a4ec7e |
children | 8267a3066476 |
line wrap: on
line diff
--- a/gtk/dw.c Mon Nov 24 18:53:07 2003 +0000 +++ b/gtk/dw.c Tue Dec 02 18:40:27 2003 +0000 @@ -1099,6 +1099,7 @@ dw_event_reset(tmp->eve); tmp->data = data; tmp->done = FALSE; + tmp->method = FALSE; tmp->result = NULL; return tmp; @@ -1114,7 +1115,7 @@ int dw_dialog_dismiss(DWDialog *dialog, void *result) { dialog->result = result; - if(pthread_self() == _dw_thread || _dw_thread == (pthread_t)-1) + if(dialog->method) gtk_main_quit(); else dw_event_post(dialog->eve); @@ -1142,9 +1143,15 @@ } if(pthread_self() == _dw_thread) + { + dialog->method = TRUE; gtk_main(); + } else + { + dialog->method = FALSE; dw_event_wait(dialog->eve, -1); + } if(newprocess) {