Having a blocking subscription running like below halts the program at redisGetReply
(source: hiredis#pipelining)
void subscribe (std::string& key, Subscriber* subscriber)
{
void* reply = redisCommand (redis, "SUBSCRIBE %s", key.c_str ());
freeReplyObject (reply);
while (redisGetReply (redis, &reply) == REDIS_OK)
{
subscriber -> notify ();
freeReplyObject (reply);
}
}
I thought by invoking redisFree
(thru signal handling) the socket would be closed and redisGetReply
returned, as mentioned at hiredis#cleaning-up, instead it throws a memory access violation.