summaryrefslogtreecommitdiff
path: root/src/ae.c
diff options
context:
space:
mode:
authorwangyuan21 <wangyuan21@baidu.com>2019-12-31 19:53:00 +0800
committerwangyuan21 <wangyuan21@baidu.com>2019-12-31 19:57:02 +0800
commit3848849013e6ec7efa244897f5fdebb843fcfaa4 (patch)
tree8661c13d894d2321c26c495cff50b31574c65cdb /src/ae.c
parent6e4f70b8170e14ba8a2ada2fde4a75e073effee3 (diff)
downloadredis-3848849013e6ec7efa244897f5fdebb843fcfaa4.tar.gz
free time event when delete eventloop
Diffstat (limited to 'src/ae.c')
-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);
}