mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-28 15:24:49 -05:00
Avoid freeing the backend in notify_remote_exit(), since that's
called from within a backend function which will expect its own backend pointer to still be valid on return. Instead, move all the real functionality of notify_remote_exit() out into a GTK idle function. [originally from svn r8304]
This commit is contained in:
parent
3a3abd211b
commit
0cef8a897d
@ -75,6 +75,7 @@ struct gui_data {
|
|||||||
int mouseptr_visible;
|
int mouseptr_visible;
|
||||||
int busy_status;
|
int busy_status;
|
||||||
guint term_paste_idle_id;
|
guint term_paste_idle_id;
|
||||||
|
guint term_exit_idle_id;
|
||||||
int alt_keycode;
|
int alt_keycode;
|
||||||
int alt_digits;
|
int alt_digits;
|
||||||
char wintitle[sizeof(((Config *)0)->wintitle)];
|
char wintitle[sizeof(((Config *)0)->wintitle)];
|
||||||
@ -1220,9 +1221,9 @@ void frontend_keypress(void *handle)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_remote_exit(void *frontend)
|
static gint idle_exit_func(gpointer data)
|
||||||
{
|
{
|
||||||
struct gui_data *inst = (struct gui_data *)frontend;
|
struct gui_data *inst = (struct gui_data *)data;
|
||||||
int exitcode;
|
int exitcode;
|
||||||
|
|
||||||
if (!inst->exited &&
|
if (!inst->exited &&
|
||||||
@ -1244,6 +1245,16 @@ void notify_remote_exit(void *frontend)
|
|||||||
}
|
}
|
||||||
gtk_widget_show(inst->restartitem);
|
gtk_widget_show(inst->restartitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_idle_remove(inst->term_exit_idle_id);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void notify_remote_exit(void *frontend)
|
||||||
|
{
|
||||||
|
struct gui_data *inst = (struct gui_data *)frontend;
|
||||||
|
|
||||||
|
inst->term_exit_idle_id = gtk_idle_add(idle_exit_func, inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint timer_trigger(gpointer data)
|
static gint timer_trigger(gpointer data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user