aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-08 14:33:35 -0600
committerTom Tromey <tromey@adacore.com>2020-04-08 14:47:58 -0600
commit2950fdf7423a404f6ebc691606d04917fd68228a (patch)
tree3072d75a13dd55ea955f206737a2b75a5a547003 /gdb/nat
parent62fe396b1cba6b0c3d06b758d9f8254c6d538ad8 (diff)
downloadgdb-2950fdf7423a404f6ebc691606d04917fd68228a.zip
gdb-2950fdf7423a404f6ebc691606d04917fd68228a.tar.gz
gdb-2950fdf7423a404f6ebc691606d04917fd68228a.tar.bz2
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 <tromey@adacore.com> * windows-nat.c (handle_exception) (windows_nat_target::thread_name): Update. * nat/windows-nat.h (windows_thread_info): Remove destructor. <name>: Now unique_xmalloc_ptr.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/windows-nat.h7
1 files changed, 1 insertions, 6 deletions
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<char> name;
};
#endif