summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangyuan21 <wangyuan21@baidu.com>2019-12-31 19:53:00 +0800
committerantirez <antirez@gmail.com>2020-02-27 18:02:30 +0100
commitdd4798802c82ce674be00d908a66903f46dda5a6 (patch)
tree06794868690e10ff18f1f17e0a2cda9e6b0cbbcb
parentecf3b2ef320f8e9d07ed05634be432d8bd9529db (diff)
downloadredis-dd4798802c82ce674be00d908a66903f46dda5a6.tar.gz
free time event when delete eventloop
-rw-r--r--src/ae.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ae.c b/src/ae.c
index 2c1dae512..248096e1f 100644
--- a/src/ae.c
+++ b/src/ae.c
@@ -135,6 +135,13 @@ void aeDeleteEventLoop(aeEventLoop *eventLoop) {
aeApiFree(eventLoop);
zfree(eventLoop->events);
zfree(eventLoop->fired);
+ /* Free time event. */
+ aeTimeEvent *next_te, *te = eventLoop->timeEventHead;
+ while (te) {
+ next_te = te->next;
+ zfree(te);
+ te = next_te;
+ }
zfree(eventLoop);
}