Change type of scoped_input_handler::m_quit_handler
Simon pointed out that scoped_input_handler::m_quit_handler must have the correct scoped_restore_tmpl type, to avoid binding to a temporary. This patch fixes the problem. gdb/ChangeLog 2017-09-22 Tom Tromey <tom@tromey.com> * utils.c (class scoped_input_handler) <m_quit_handler>: Change type to scoped_restore_tmpl. <scoped_input_handler>: Initialize m_quit_handler directly. Reviewed-By: Pedro Alves <palves@redhat.com>
This commit is contained in:
parent
61e3bf5f83
commit
c2f97536b7
2 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2017-09-22 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* utils.c (class scoped_input_handler) <m_quit_handler>: Change
|
||||||
|
type to scoped_restore_tmpl.
|
||||||
|
<scoped_input_handler>: Initialize m_quit_handler directly.
|
||||||
|
|
||||||
2017-09-22 Sergio Durigan Junior <sergiodj@redhat.com>
|
2017-09-22 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
* cli/cli-cmds.c (pwd_command): Use "getcwd (NULL, 0)".
|
* cli/cli-cmds.c (pwd_command): Use "getcwd (NULL, 0)".
|
||||||
|
|
|
@ -904,8 +904,7 @@ class scoped_input_handler
|
||||||
public:
|
public:
|
||||||
|
|
||||||
scoped_input_handler ()
|
scoped_input_handler ()
|
||||||
: m_quit_handler (make_scoped_restore (&quit_handler,
|
: m_quit_handler (&quit_handler, default_quit_handler),
|
||||||
default_quit_handler)),
|
|
||||||
m_ui (NULL)
|
m_ui (NULL)
|
||||||
{
|
{
|
||||||
target_terminal::ours ();
|
target_terminal::ours ();
|
||||||
|
@ -928,7 +927,7 @@ private:
|
||||||
target_terminal::scoped_restore_terminal_state m_term_state;
|
target_terminal::scoped_restore_terminal_state m_term_state;
|
||||||
|
|
||||||
/* Save and restore the quit handler. */
|
/* Save and restore the quit handler. */
|
||||||
scoped_restore m_quit_handler;
|
scoped_restore_tmpl<quit_handler_ftype *> m_quit_handler;
|
||||||
|
|
||||||
/* The saved UI, if non-NULL. */
|
/* The saved UI, if non-NULL. */
|
||||||
struct ui *m_ui;
|
struct ui *m_ui;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue