+2013-05-30 Tom Tromey <tromey@redhat.com>
+
+ * cli/cli-logging.c (set_logging_redirect): Unconditionally
+ call do_cleanups.
+
2013-05-30 Tom Tromey <tromey@redhat.com>
* varobj.c (c_value_of_root): Call do_cleanups along all
static void
set_logging_redirect (char *args, int from_tty, struct cmd_list_element *c)
{
- struct cleanup *cleanups = NULL;
+ struct cleanup *cleanups;
struct ui_file *output, *new_logging_no_redirect_file;
struct ui_out *uiout = current_uiout;
|| (logging_redirect == 0 && logging_no_redirect_file != NULL))
return;
+ cleanups = make_cleanup (null_cleanup, NULL);
+
if (logging_redirect != 0)
{
gdb_assert (logging_no_redirect_file != NULL);
/* ui_out_redirect still has not been called for next
gdb_stdout. */
- cleanups = make_cleanup_ui_file_delete (gdb_stdout);
+ make_cleanup_ui_file_delete (gdb_stdout);
output = logging_no_redirect_file;
new_logging_no_redirect_file = NULL;
|| ui_out_redirect (uiout, output) < 0)
warning (_("Current output protocol does not support redirection"));
- if (logging_redirect != 0)
- do_cleanups (cleanups);
+ do_cleanups (cleanups);
}
static void