free time event when delete eventloop

This commit is contained in:
wangyuan21 2019-12-31 19:53:00 +08:00
parent c0d6c9a0c1
commit 834f18ab03

View File

@ -135,6 +135,13 @@ void aeDeleteEventLoop(aeEventLoop *eventLoop) {
aeApiFree(eventLoop); aeApiFree(eventLoop);
zfree(eventLoop->events); zfree(eventLoop->events);
zfree(eventLoop->fired); 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); zfree(eventLoop);
} }