Exemple #1
0
static void swEventTimer_free(swTimer *timer)
{
    if (timer->root)
    {
        swTimer_node_destory(&timer->root);
    }
}
Exemple #2
0
static void swTimer_free(swTimer *timer)
{
    swHashMap_free(timer->list);

    if (timer->use_pipe)
    {
        timer->pipe.close(&timer->pipe);
    }
    else if (timer->fd > 2)
    {
        if (close(timer->fd) < 0)
        {
            swSysError("close(%d) failed.", timer->fd);
        }
    }

    if (timer->root)
    {
        swTimer_node_destory(&timer->root);
    }
}