mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-12 19:03:10 +03:00
Ticket #4244: fix segfault on dialog before panels get visible.
If some small dialog (error message or password request) is displayed before main mc window gets visible, the segfault occures. The cause of segfault is update of prompt that is not created yet. (setup_mc, create_file_manager): move creation of event channel from setup_mc() to create_file_manager(), make that after creation of all file manager widgets. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
333b20557e
commit
0375997c78
@ -859,11 +859,6 @@ setup_mc (void)
|
||||
#endif /* HAVE_CHARSET */
|
||||
#endif /* HAVE_SLANG */
|
||||
|
||||
#ifdef ENABLE_SUBSHELL
|
||||
if (mc_global.tty.use_subshell)
|
||||
add_select_channel (mc_global.tty.subshell_pty, load_prompt, NULL);
|
||||
#endif /* !ENABLE_SUBSHELL */
|
||||
|
||||
if ((tty_baudrate () < 9600) || mc_global.tty.slow_terminal)
|
||||
verbose = FALSE;
|
||||
}
|
||||
@ -942,6 +937,13 @@ create_file_manager (void)
|
||||
the_bar = buttonbar_new ();
|
||||
group_add_widget (g, the_bar);
|
||||
midnight_set_buttonbar (the_bar);
|
||||
|
||||
#ifdef ENABLE_SUBSHELL
|
||||
/* Must be done after creation of cmdline and promt widgets to avoid potential
|
||||
NULL dereference in load_prompt() -> ... -> setup_cmdline() -> label_set_text(). */
|
||||
if (mc_global.tty.use_subshell)
|
||||
add_select_channel (mc_global.tty.subshell_pty, load_prompt, NULL);
|
||||
#endif /* !ENABLE_SUBSHELL */
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
x
Reference in New Issue
Block a user