This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Use delete instead of xfree for gdb_timer
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 2 Jun 2017 21:24:48 -0000
- Subject: [binutils-gdb] Use delete instead of xfree for gdb_timer
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0e05cf3a61e1996829359e1c32eedb6820930331
commit 0e05cf3a61e1996829359e1c32eedb6820930331
Author: Simon Marchi <simon.marchi@ericsson.com>
Date: Fri Jun 2 23:24:21 2017 +0200
Use delete instead of xfree for gdb_timer
gdb_timer objects are new'ed in create_timer, but xfree'd in
poll_timers. Use delete instead.
gdb/ChangeLog:
* event-loop.c (poll_timers): Unallocate timer using delete
instead of xfree.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/event-loop.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0338387..ed063fc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-02 Simon Marchi <simon.marchi@ericsson.com>
+
+ * event-loop.c (poll_timers): Unallocate timer using delete
+ instead of xfree.
+
2017-06-02 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (struct breakpoint_ops) <dtor>: Remove.
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 4b3ddb8..7304ca7 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -1270,7 +1270,7 @@ poll_timers (void)
/* Delete the timer before calling the callback, not after, in
case the callback itself decides to try deleting the timer
too. */
- xfree (timer_ptr);
+ delete timer_ptr;
/* Call the procedure associated with that timer. */
(proc) (client_data);