TCP_RELEASE (cbd);
+ if ((cbd->flags & (LUA_TCP_FLAG_FINISHED|LUA_TCP_FLAG_CONNECTED)) ==
+ (LUA_TCP_FLAG_FINISHED|LUA_TCP_FLAG_CONNECTED)) {
+ /* A callback has called `close` method, so we need to release a refcount */
+ TCP_RELEASE (cbd);
+ }
+
callback_called = TRUE;
}
lua_settop (L, top);
TCP_RELEASE (cbd);
+
+ if ((cbd->flags & (LUA_TCP_FLAG_FINISHED|LUA_TCP_FLAG_CONNECTED)) ==
+ (LUA_TCP_FLAG_FINISHED|LUA_TCP_FLAG_CONNECTED)) {
+ /* A callback has called `close` method, so we need to release a refcount */
+ TCP_RELEASE (cbd);
+ }
}
lua_thread_pool_restore_callback (&cbs);
lua_settop (L, top);
TCP_RELEASE (cbd);
lua_thread_pool_restore_callback (&cbs);
+
+ if ((cbd->flags & (LUA_TCP_FLAG_FINISHED|LUA_TCP_FLAG_CONNECTED)) ==
+ (LUA_TCP_FLAG_FINISHED|LUA_TCP_FLAG_CONNECTED)) {
+ /* A callback has called `close` method, so we need to release a refcount */
+ TCP_RELEASE (cbd);
+ }
}
}
}