* [PATCH] Use delete instead of xfree for gdb_timer
@ 2017-05-31 14:47 Simon Marchi
2017-06-02 21:25 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2017-05-31 14:47 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Use delete instead of xfree for gdb_timer
2017-05-31 14:47 [PATCH] Use delete instead of xfree for gdb_timer Simon Marchi
@ 2017-06-02 21:25 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2017-06-02 21:25 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
On 2017-05-31 16:47, Simon Marchi wrote:
> 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);
I pushed this in.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-02 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 14:47 [PATCH] Use delete instead of xfree for gdb_timer Simon Marchi
2017-06-02 21:25 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).