Bläddra i källkod

[Minor] Prevent race condition in Redis ctx refcounting

tags/1.8.1
Vsevolod Stakhov 5 år sedan
förälder
incheckning
315ecdf30d
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4
    0
      src/lua/lua_redis.c

+ 4
- 0
src/lua/lua_redis.c Visa fil

@@ -480,6 +480,8 @@ lua_redis_push_results (struct lua_redis_ctx *ctx, lua_State *L)
static void
lua_redis_cleanup_events (struct lua_redis_ctx *ctx)
{
REDIS_RETAIN (ctx); /* To avoid preliminary destruction */

while (!g_queue_is_empty (ctx->events_cleanup)) {
struct lua_redis_result *result = g_queue_pop_head (ctx->events_cleanup);

@@ -488,6 +490,8 @@ lua_redis_cleanup_events (struct lua_redis_ctx *ctx)

g_free (result);
}

REDIS_RELEASE (ctx);
}

/**

Laddar…
Avbryt
Spara