Exemple #1
0
static int m_img_dict_gc(lua_State * L)
{
    image_dict *ad, **add;
    add = (image_dict **) luaL_checkudata(L, 1, TYPE_IMG_DICT);
    ad = *add;
#ifdef DEBUG
    printf("\n===== IMG_DICT GC FREE ===== ad=%d\n", ad);
#endif
    if (img_state(ad) < DICT_REFERED)
        free_image_dict(ad);
    return 0;
}
Exemple #2
0
static int m_img_dict_gc(lua_State * L)
{
    image_dict *ad, **add;
    add = (image_dict **) luaL_checkudata(L, 1, TYPE_IMG_DICT);
    ad = *add;
    if (img_luaref(ad) > 0) {
        luaL_error(L, "disposing image dict that has references");
    } else {
        /* we need to check this */
        if (img_state(ad) < DICT_REFERED) {
            free_image_dict(ad);
        }
        /* till here */
    }
    return 0;
}