Esempio n. 1
0
int LuaTable::releaseRef() const {
    if (m_refCount == 1 && hasMeta("__gc")) {
        // NOT STANDARD!
        invokeMeta(const_cast<LuaTable*>(this), m_metaTable, "__gc", LuaValue::NIL, LuaValue::NIL);
    }

    int r = --m_refCount;
    if (r == 0) delete this;
    return r;
}
Esempio n. 2
0
const string HasMeta::getMeta(const string &key)
{
    return hasMeta(key) ? meta[key] : "";
}