diff options
author | wangyuan21 <wangyuan21@baidu.com> | 2019-12-31 19:53:00 +0800 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2020-02-27 18:02:30 +0100 |
commit | dd4798802c82ce674be00d908a66903f46dda5a6 (patch) | |
tree | 06794868690e10ff18f1f17e0a2cda9e6b0cbbcb | |
parent | ecf3b2ef320f8e9d07ed05634be432d8bd9529db (diff) | |
download | redis-dd4798802c82ce674be00d908a66903f46dda5a6.tar.gz |
free time event when delete eventloop
-rw-r--r-- | src/ae.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); } |