summaryrefslogtreecommitdiffstats
path: root/source/core/slang-object-scope-manager.cpp
blob: 313bd4cd5e2f69f0d6a049fc354437ac5ccb0f3c (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 int numObjs = int(m_objs.Count());
    for (int 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