aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-06-02 23:24:21 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-06-02 23:24:21 +0200
commit0e05cf3a61e1996829359e1c32eedb6820930331 (patch)
tree293c8b0eeaecae5461e15839a16262b69d366064
parentc1fc2657206188767cb66813d07b9ecbb5e9ec51 (diff)
downloadgdb-0e05cf3a61e1996829359e1c32eedb6820930331.zip
gdb-0e05cf3a61e1996829359e1c32eedb6820930331.tar.gz
gdb-0e05cf3a61e1996829359e1c32eedb6820930331.tar.bz2
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/event-loop.c2
2 files changed, 6 insertions, 1 deletions
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);