| 8517 | } |
| 8518 | |
| 8519 | void moduleUnregisterCommands(struct RedisModule *module) { |
| 8520 | /* Unregister all the commands registered by this module. */ |
| 8521 | dictIterator *di = dictGetSafeIterator(server.commands); |
| 8522 | dictEntry *de; |
| 8523 | while ((de = dictNext(di)) != NULL) { |
| 8524 | struct redisCommand *cmd = dictGetVal(de); |
| 8525 | if (cmd->proc == RedisModuleCommandDispatcher) { |
| 8526 | RedisModuleCommandProxy *cp = |
| 8527 | (void*)(unsigned long)cmd->getkeys_proc; |
| 8528 | sds cmdname = cp->rediscmd->name; |
| 8529 | if (cp->module == module) { |
| 8530 | dictDelete(server.commands,cmdname); |
| 8531 | dictDelete(server.orig_commands,cmdname); |
| 8532 | sdsfree(cmdname); |
| 8533 | zfree(cp->rediscmd); |
| 8534 | zfree(cp); |
| 8535 | } |
| 8536 | } |
| 8537 | } |
| 8538 | dictReleaseIterator(di); |
| 8539 | } |
| 8540 | |
| 8541 | /* Load a module and initialize it. On success C_OK is returned, otherwise |
| 8542 | * C_ERR is returned. */ |
no test coverage detected