Skip to content

Commit 2c37b56

Browse files
committed
fix tests
1 parent cc671c6 commit 2c37b56

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

swoole_client.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,10 @@ static PHP_METHOD(swoole_client, close)
16831683
if (force || !cli->keep || swConnection_error(SwooleG.error) == SW_CLOSE)
16841684
{
16851685
uint8_t need_free = !cli->async;
1686-
ret = cli->close(cli);
1686+
if (unlikely(SWOOLE_G(req_status) != PHP_SWOOLE_CALL_USER_SHUTDOWNFUNC_BEGIN))
1687+
{
1688+
ret = cli->close(cli);
1689+
}
16871690
if (need_free)
16881691
{
16891692
php_swoole_client_free(getThis(), cli);

swoole_event.cc

-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ void php_swoole_event_wait()
315315
}
316316
#endif
317317
}
318-
php_swoole_timer_clear_all();
319318
swReactor_destory(SwooleG.main_reactor);
320319
efree(SwooleG.main_reactor);
321320
SwooleG.main_reactor = NULL;

swoole_redis_coro.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ static sw_inline swRedisClient* swoole_get_redis_client(zval *zobject)
919919

920920
static sw_inline Socket* swoole_redis_coro_get_socket(redisContext *context)
921921
{
922-
if (context->fd > 0)
922+
if (context->fd > 0 && SwooleG.main_reactor)
923923
{
924924
swConnection *conn = swReactor_get(SwooleG.main_reactor, context->fd);
925925
return conn ? (Socket *) conn->object : nullptr;

0 commit comments

Comments
 (0)