This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 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.
---
 gdb/event-loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]