mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-01 18:32:32 +08:00
Split the tui_win_info destructor
This patch adds destructors to tui_source_window and tui_data_window, and splits ~tui_win_info as appropriate. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-data.h (struct tui_source_window) (struct tui_data_window): Declare destructors. * tui/tui-data.c (~tui_source_window, ~tui_data_window): New destructors. (tui_win_info): Simplify.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tui/tui-data.h (struct tui_source_window)
|
||||||
|
(struct tui_data_window): Declare destructors.
|
||||||
|
* tui/tui-data.c (~tui_source_window, ~tui_data_window): New
|
||||||
|
destructors.
|
||||||
|
(tui_win_info): Simplify.
|
||||||
|
|
||||||
2019-06-25 Tom Tromey <tom@tromey.com>
|
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-winsource.c (tui_display_main)
|
* tui/tui-winsource.c (tui_display_main)
|
||||||
|
@ -617,47 +617,43 @@ tui_add_content_elements (struct tui_gen_win_info *win_info,
|
|||||||
return index_start;
|
return index_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tui_source_window::~tui_source_window ()
|
||||||
|
{
|
||||||
|
if (detail.source_info.fullname)
|
||||||
|
{
|
||||||
|
xfree (detail.source_info.fullname);
|
||||||
|
detail.source_info.fullname = NULL;
|
||||||
|
}
|
||||||
|
struct tui_gen_win_info *generic_win = detail.source_info.execution_info;
|
||||||
|
if (generic_win != NULL)
|
||||||
|
{
|
||||||
|
tui_delete_win (generic_win->handle);
|
||||||
|
generic_win->handle = NULL;
|
||||||
|
tui_free_win_content (generic_win);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tui_data_window::~tui_data_window ()
|
||||||
|
{
|
||||||
|
if (generic.content != NULL)
|
||||||
|
{
|
||||||
|
tui_free_data_content (detail.data_display_info.regs_content,
|
||||||
|
detail.data_display_info.regs_content_count);
|
||||||
|
detail.data_display_info.regs_content = NULL;
|
||||||
|
detail.data_display_info.regs_content_count = 0;
|
||||||
|
tui_free_data_content (detail.data_display_info.data_content,
|
||||||
|
detail.data_display_info.data_content_count);
|
||||||
|
detail.data_display_info.data_content = NULL;
|
||||||
|
detail.data_display_info.data_content_count = 0;
|
||||||
|
detail.data_display_info.regs_column_count = 1;
|
||||||
|
detail.data_display_info.display_regs = FALSE;
|
||||||
|
generic.content = NULL;
|
||||||
|
generic.content_size = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tui_win_info::~tui_win_info ()
|
tui_win_info::~tui_win_info ()
|
||||||
{
|
{
|
||||||
struct tui_gen_win_info *generic_win;
|
|
||||||
|
|
||||||
switch (generic.type)
|
|
||||||
{
|
|
||||||
case SRC_WIN:
|
|
||||||
case DISASSEM_WIN:
|
|
||||||
if (detail.source_info.fullname)
|
|
||||||
{
|
|
||||||
xfree (detail.source_info.fullname);
|
|
||||||
detail.source_info.fullname = NULL;
|
|
||||||
}
|
|
||||||
generic_win = detail.source_info.execution_info;
|
|
||||||
if (generic_win != NULL)
|
|
||||||
{
|
|
||||||
tui_delete_win (generic_win->handle);
|
|
||||||
generic_win->handle = NULL;
|
|
||||||
tui_free_win_content (generic_win);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case DATA_WIN:
|
|
||||||
if (generic.content != NULL)
|
|
||||||
{
|
|
||||||
tui_free_data_content (detail.data_display_info.regs_content,
|
|
||||||
detail.data_display_info.regs_content_count);
|
|
||||||
detail.data_display_info.regs_content = NULL;
|
|
||||||
detail.data_display_info.regs_content_count = 0;
|
|
||||||
tui_free_data_content (detail.data_display_info.data_content,
|
|
||||||
detail.data_display_info.data_content_count);
|
|
||||||
detail.data_display_info.data_content = NULL;
|
|
||||||
detail.data_display_info.data_content_count = 0;
|
|
||||||
detail.data_display_info.regs_column_count = 1;
|
|
||||||
detail.data_display_info.display_regs = FALSE;
|
|
||||||
generic.content = NULL;
|
|
||||||
generic.content_size = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (generic.handle != NULL)
|
if (generic.handle != NULL)
|
||||||
{
|
{
|
||||||
tui_delete_win (generic.handle);
|
tui_delete_win (generic.handle);
|
||||||
|
@ -294,6 +294,7 @@ public:
|
|||||||
struct tui_source_window : public tui_win_info
|
struct tui_source_window : public tui_win_info
|
||||||
{
|
{
|
||||||
explicit tui_source_window (enum tui_win_type type);
|
explicit tui_source_window (enum tui_win_type type);
|
||||||
|
~tui_source_window () override;
|
||||||
DISABLE_COPY_AND_ASSIGN (tui_source_window);
|
DISABLE_COPY_AND_ASSIGN (tui_source_window);
|
||||||
|
|
||||||
void clear_detail () override;
|
void clear_detail () override;
|
||||||
@ -302,6 +303,7 @@ struct tui_source_window : public tui_win_info
|
|||||||
struct tui_data_window : public tui_win_info
|
struct tui_data_window : public tui_win_info
|
||||||
{
|
{
|
||||||
tui_data_window ();
|
tui_data_window ();
|
||||||
|
~tui_data_window () override;
|
||||||
DISABLE_COPY_AND_ASSIGN (tui_data_window);
|
DISABLE_COPY_AND_ASSIGN (tui_data_window);
|
||||||
|
|
||||||
void clear_detail () override;
|
void clear_detail () override;
|
||||||
|
Reference in New Issue
Block a user