summaryrefslogtreecommitdiffstats
path: root/source/core/slang-object-scope-manager.cpp
blob: 2e7b7dfe39314fed05a9792ac4e411d5e3740583 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "slang-object-scope-manager.h"

namespace Slang {

void ObjectScopeManager::_releaseAll()
{
    RefObject*const* objs = m_objs.begin();
    const Index numObjs = m_objs.getCount();
    for (Index i = 0; i < numObjs; ++i)
    {
        objs[i]->decreaseReference();
    }
}

void ObjectScopeManager::clear()
{
    _releaseAll();
    // Free the memory as well as resizing
    m_objs = List<RefObject*>();
}

} // namespace Slang