From 2950fdf7423a404f6ebc691606d04917fd68228a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 8 Apr 2020 14:33:35 -0600 Subject: Make windows_thread_info::name a unique_xmalloc_ptr This changes windows_thread_info::name to be a unique_xmalloc_ptr, removing some manual memory management. gdb/ChangeLog 2020-04-08 Tom Tromey * windows-nat.c (handle_exception) (windows_nat_target::thread_name): Update. * nat/windows-nat.h (windows_thread_info): Remove destructor. : Now unique_xmalloc_ptr. --- gdb/nat/windows-nat.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gdb/nat') diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 27fd7ed..543de89 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -32,11 +32,6 @@ struct windows_thread_info { } - ~windows_thread_info () - { - xfree (name); - } - DISABLE_COPY_AND_ASSIGN (windows_thread_info); /* The Win32 thread identifier. */ @@ -77,7 +72,7 @@ struct windows_thread_info bool reload_context = false; /* The name of the thread, allocated by xmalloc. */ - char *name = nullptr; + gdb::unique_xmalloc_ptr name; }; #endif -- cgit v1.1