1585346868 8 месяцев назад
Родитель
Сommit
57af9f7104
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      src/redis.cpp

+ 6 - 3
src/redis.cpp

@@ -110,7 +110,7 @@ redisContext* module::redis_pool::reget(redisContext* ctx)
     return context;
 }
 
-sol::object module::redis_pool::reply(sol::this_state* ts,redisContext* ctx, redisReply* reply)
+sol::object module::redis_pool::reply(sol::this_state* ts,redisContext* ctx, redisReply* reply,bool in)
 {
     if (reply == NULL) {
         if (ctx->err)
@@ -156,10 +156,13 @@ sol::object module::redis_pool::reply(sol::this_state* ts,redisContext* ctx, red
     }
     catch (const std::exception& e)
     {
-        freeReplyObject(reply);
+        if(in)
+            freeReplyObject(reply);
+        
         throw ylib::exception(e.what());
     }
-    freeReplyObject(reply);
+    if(in)
+        freeReplyObject(reply);
     return result;
 }