コード例 #1
0
ファイル: LuaTable.cpp プロジェクト: GHScan/DailyProjects
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;
}
コード例 #2
0
ファイル: HasMeta.cpp プロジェクト: Angeldude/pd
const string HasMeta::getMeta(const string &key)
{
    return hasMeta(key) ? meta[key] : "";
}