Fix crash during RDB save with module events

Former-commit-id: 0f7eac411eccb853d7e50152e2bbd1ee28e6ee53
This commit is contained in:
John Sully 2020-05-11 01:02:58 -04:00
parent 5ea1948d68
commit 268f2efb48

View File

@ -7222,6 +7222,8 @@ void moduleFireServerEvent(uint64_t eid, int subid, void *data) {
* cheap if there are no registered modules. */
if (listLength(RedisModule_EventListeners) == 0) return;
aeAcquireLock();
listIter li;
listNode *ln;
listRewind(RedisModule_EventListeners,&li);
@ -7286,6 +7288,8 @@ void moduleFireServerEvent(uint64_t eid, int subid, void *data) {
moduleFreeContext(&ctx);
}
}
aeReleaseLock();
}
/* Remove all the listeners for this module: this is used before unloading