diff options
-rw-r--r-- | include/qemu/timer.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/qemu/timer.h b/include/qemu/timer.h index bdecc5b41f..61296ea980 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -610,17 +610,6 @@ static inline QEMUTimer *timer_new_ms(QEMUClockType type, QEMUTimerCB *cb, void timer_deinit(QEMUTimer *ts); /** - * timer_free: - * @ts: the timer - * - * Free a timer (it must not be on the active list) - */ -static inline void timer_free(QEMUTimer *ts) -{ - g_free(ts); -} - -/** * timer_del: * @ts: the timer * @@ -632,6 +621,19 @@ static inline void timer_free(QEMUTimer *ts) void timer_del(QEMUTimer *ts); /** + * timer_free: + * @ts: the timer + * + * Free a timer. This will call timer_del() for you to remove + * the timer from the active list if it was still active. + */ +static inline void timer_free(QEMUTimer *ts) +{ + timer_del(ts); + g_free(ts); +} + +/** * timer_mod_ns: * @ts: the timer * @expire_time: the expiry time in nanoseconds |