Пример #1
0
void CScriptSystem::Update(float currTime, float frameTime, int aiTicks)
{
    // garbage-collect script-variables
    int gcCount = GetScriptSystem()->GetGCCount();

    if ((gcCount - m_lastGarbageCollectCount) > LUA_MAX_GARBAGE_PERIOD)
    {
        ForceGarbageCollection();
        m_lastGarbageCollectCount = GetGCCount();
    }
}
Пример #2
0
HBRUSH AwtBrush::SafeCreateSolidBrush(COLORREF cr) {
    //!CQ could do partial flushes more often, based on LRU or refcount == 1, etc
    HBRUSH hbr = ::CreateSolidBrush(cr);
    if (!hbr) {
        // Flush cache (it calls back to Release each Brush in it). Any current references to those
        // brushes will remain valid until the last Release is called
        cache.clear();
        hbr = ::CreateSolidBrush(cr);
        // if that didn't work, then try a gc to cleanup potential java objects that
        // are hanging onto our objects
        if (!hbr) {
            ForceGarbageCollection();
            hbr = ::CreateSolidBrush(cr);
            ASSERT(hbr != NULL);
        }
    }
    return hbr;
}