Memory leak fix on config, and redisDb dtor
Former-commit-id: b92bbf4de8ffc3edc965e2f9da4dd82ed7071559
This commit is contained in:
parent
41c75234bd
commit
8f6f496c7e
@ -405,7 +405,7 @@ void loadServerConfigFromString(char *config) {
|
|||||||
} else if ((!strcasecmp(argv[0],"slaveof") ||
|
} else if ((!strcasecmp(argv[0],"slaveof") ||
|
||||||
!strcasecmp(argv[0],"replicaof")) && argc == 3) {
|
!strcasecmp(argv[0],"replicaof")) && argc == 3) {
|
||||||
slaveof_linenum = linenum;
|
slaveof_linenum = linenum;
|
||||||
replicationAddMaster(sdsnew(argv[1]), atoi(argv[2]));
|
replicationAddMaster(argv[1], atoi(argv[2]));
|
||||||
} else if ((!strcasecmp(argv[0],"repl-ping-slave-period") ||
|
} else if ((!strcasecmp(argv[0],"repl-ping-slave-period") ||
|
||||||
!strcasecmp(argv[0],"repl-ping-replica-period")) &&
|
!strcasecmp(argv[0],"repl-ping-replica-period")) &&
|
||||||
argc == 2)
|
argc == 2)
|
||||||
|
@ -1305,6 +1305,14 @@ void setExpire(client *c, redisDb *db, robj *key, robj *subkey, long long when)
|
|||||||
rememberSlaveKeyWithExpire(db,key);
|
rememberSlaveKeyWithExpire(db,key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
redisDb::~redisDb()
|
||||||
|
{
|
||||||
|
dictRelease(watched_keys);
|
||||||
|
dictRelease(ready_keys);
|
||||||
|
dictRelease(blocking_keys);
|
||||||
|
listRelease(defrag_later);
|
||||||
|
}
|
||||||
|
|
||||||
void setExpire(client *c, redisDb *db, robj *key, expireEntry &&e)
|
void setExpire(client *c, redisDb *db, robj *key, expireEntry &&e)
|
||||||
{
|
{
|
||||||
dictEntry *kde;
|
dictEntry *kde;
|
||||||
|
@ -1127,10 +1127,13 @@ typedef struct clientReplyBlock {
|
|||||||
/* Redis database representation. There are multiple databases identified
|
/* Redis database representation. There are multiple databases identified
|
||||||
* by integers from 0 (the default database) up to the max configured
|
* by integers from 0 (the default database) up to the max configured
|
||||||
* database. The database number is the 'id' field in the structure. */
|
* database. The database number is the 'id' field in the structure. */
|
||||||
typedef struct redisDb {
|
struct redisDb {
|
||||||
redisDb()
|
redisDb()
|
||||||
: expireitr(nullptr)
|
: expireitr(nullptr)
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
~redisDb();
|
||||||
|
|
||||||
dict *pdict; /* The keyspace for this DB */
|
dict *pdict; /* The keyspace for this DB */
|
||||||
expireset *setexpire;
|
expireset *setexpire;
|
||||||
expireset::setiter expireitr;
|
expireset::setiter expireitr;
|
||||||
@ -1142,7 +1145,7 @@ typedef struct redisDb {
|
|||||||
long long last_expire_set; /* when the last expire was set */
|
long long last_expire_set; /* when the last expire was set */
|
||||||
double avg_ttl; /* Average TTL, just for stats */
|
double avg_ttl; /* Average TTL, just for stats */
|
||||||
list *defrag_later; /* List of key names to attempt to defrag one by one, gradually. */
|
list *defrag_later; /* List of key names to attempt to defrag one by one, gradually. */
|
||||||
} redisDb;
|
};
|
||||||
|
|
||||||
/* Client MULTI/EXEC state */
|
/* Client MULTI/EXEC state */
|
||||||
typedef struct multiCmd {
|
typedef struct multiCmd {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user