Add a destructor to windows_thread_info that calls CloseHandle.
gdb/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* nat/windows-nat.h (struct windows_thread_info): Declare
destructor.
* nat/windows-nat.c (~windows_thread_info): New.
gdbserver/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (delete_thread_info): Don't call CloseHandle.
+2020-04-08 Tom Tromey <tromey@adacore.com>
+
+ * nat/windows-nat.h (struct windows_thread_info): Declare
+ destructor.
+ * nat/windows-nat.c (~windows_thread_info): New.
+
2020-04-08 Tom Tromey <tromey@adacore.com>
PR gdb/22992
#include "gdbsupport/common-defs.h"
#include "nat/windows-nat.h"
+windows_thread_info::~windows_thread_info ()
+{
+ CloseHandle (h);
+}
+
void
windows_thread_info::suspend ()
{
{
}
+ ~windows_thread_info ();
+
DISABLE_COPY_AND_ASSIGN (windows_thread_info);
/* Ensure that this thread has been suspended. */
+2020-04-08 Tom Tromey <tromey@adacore.com>
+
+ * win32-low.c (delete_thread_info): Don't call CloseHandle.
+
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (win32_require_context, suspend_one_thread): Use
windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
remove_thread (thread);
- CloseHandle (th->h);
delete th;
}