Exemplo n.º 1
0
static void delete_state(DVBSubContext *ctx)
{
    DVBSubRegion *region;
    DVBSubCLUT *clut;

    while (ctx->region_list != NULL)
    {
        region = ctx->region_list;

        ctx->region_list = region->next;

        delete_region_display_list(ctx, region);
        if (region->pbuf != NULL)
            av_free(region->pbuf);

        av_free(region);
    }

    while (ctx->clut_list != NULL)
    {
        clut = ctx->clut_list;

        ctx->clut_list = clut->next;

        av_free(clut);
    }

    /* Should already be null */
    if (ctx->object_list != NULL)
        av_log(0, AV_LOG_ERROR, "Memory deallocation error!\n");
}
Exemplo n.º 2
0
static void delete_regions(DVBSubContext *ctx)
{
    DVBSubRegion *region;

    while (ctx->region_list) {
        region = ctx->region_list;

        ctx->region_list = region->next;

        delete_region_display_list(ctx, region);

        av_free(region->pbuf);
        av_free(region);
    }
}