diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-11-04 09:51:35 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-11-04 09:51:35 +0000 |
commit | 9b171679a3b03c25183b40ada5fcee8bb83ed393 (patch) | |
tree | 1191833c971205bd4d17ff8adc3b39e07bd6d797 | |
parent | c523be19954ab6bcb4b524c6f6d17fb744aca242 (diff) |
fixed a crash when the external editor was terminated while opening confirmation dialog.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@715 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/compose.c | 52 |
3 files changed, 37 insertions, 25 deletions
@@ -1,5 +1,10 @@ 2005-11-04 + * src/compose.c: compose_ext_editor_kill(): fixed a crash when the + external editor was terminated while opening confirmation dialog. + +2005-11-04 + * src/prefs_common_dialog.c: prefs_junk_create(): added preset menu for learning commands. * libsylph/prefs_common.c: made the default junk commands on win32 diff --git a/ChangeLog.ja b/ChangeLog.ja index b00d8458..9b3a63de 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-11-04 + * src/compose.c: compose_ext_editor_kill(): 確認ダイアログを開いて + いるときに外部エディタが終了した場合クラッシュするのを修正。 + +2005-11-04 + * src/prefs_common_dialog.c: prefs_junk_create(): 学習コマンドの プリセットメニューを追加。 * libsylph/prefs_common.c: win32 でのデフォルトの迷惑メールコマンドを diff --git a/src/compose.c b/src/compose.c index e18e0a71..f297a47a 100644 --- a/src/compose.c +++ b/src/compose.c @@ -5202,37 +5202,39 @@ static gboolean compose_ext_editor_kill(Compose *compose) GTK_STOCK_YES, GTK_STOCK_NO, NULL); g_free(msg); - if (val == G_ALERTDEFAULT) { + if (val != G_ALERTDEFAULT) + return FALSE; + } + + if (compose->exteditor_tag != 0) { + g_source_remove(compose->exteditor_tag); + compose->exteditor_tag = 0; + } + + if (compose->exteditor_pid != 0) { #ifdef G_OS_WIN32 - if (TerminateProcess(compose->exteditor_pid, 1) == 0) - g_warning("TerminateProcess() failed: %d\n", - GetLastError()); + if (TerminateProcess(compose->exteditor_pid, 1) == 0) + g_warning("TerminateProcess() failed: %d\n", + GetLastError()); #else - if (kill(compose->exteditor_pid, SIGTERM) < 0) - perror("kill"); + if (kill(compose->exteditor_pid, SIGTERM) < 0) + perror("kill"); #endif + g_message("Terminated process group id: %d\n", + compose->exteditor_pid); + g_message("Temporary file: %s\n", + compose->exteditor_file); + compose->exteditor_pid = 0; + } - g_message("Terminated process group id: %d", - compose->exteditor_pid); - g_message("Temporary file: %s", - compose->exteditor_file); - - while (compose->exteditor_pid != 0) - gtk_main_iteration(); - } else - return FALSE; - } else if (compose->exteditor_tag != 0) { - g_source_remove(compose->exteditor_tag); - compose->exteditor_tag = 0; - if (compose->exteditor_file) { - g_unlink(compose->exteditor_file); - g_free(compose->exteditor_file); - compose->exteditor_file = NULL; - } - compose->exteditor_pid = 0; - compose_set_ext_editor_sensitive(compose, TRUE); + if (compose->exteditor_file) { + g_unlink(compose->exteditor_file); + g_free(compose->exteditor_file); + compose->exteditor_file = NULL; } + compose_set_ext_editor_sensitive(compose, TRUE); + return TRUE; } |