示例#1
0
文件: Base.c 项目: cophp/swoole-src
void swoole_clean(void)
{
    //释放全局内存
    if (SwooleG.memory_pool != NULL)
    {
        SwooleG.memory_pool->destroy(SwooleG.memory_pool);
        SwooleG.memory_pool = NULL;
        if (SwooleG.timer.fd > 0)
        {
            swTimer_free(&SwooleG.timer);
        }
        bzero(&SwooleG, sizeof(SwooleG));
    }
}
示例#2
0
void swoole_clean(void)
{
    //free the global memory
    if (SwooleG.memory_pool != NULL)
    {
        if (SwooleG.timer.fd > 0)
        {
            swTimer_free(&SwooleG.timer);
        }
        if (SwooleG.main_reactor)
        {
            SwooleG.main_reactor->free(SwooleG.main_reactor);
        }
        SwooleG.memory_pool->destroy(SwooleG.memory_pool);
        bzero(&SwooleG, sizeof(SwooleG));
    }
}