source: trunk/src/root.cc @ 256

Last change on this file since 256 was 256, checked in by epyon, 11 years ago
  • various minor fixes
File size: 629 bytes
Line 
1// Copyright (C) 2012-2014 ChaosForge Ltd
2// http://chaosforge.org/
3//
4// This file is part of NV Libraries.
5// For conditions of distribution and use, see copyright notice in nv.hh
6
7#include "nv/root.hh"
8
9#include "nv/uid.hh"
10#include "nv/lua/lua_state.hh"
11
12void nv::root::object_created( object* o )
13{
14        if ( m_uid_store )
15        {
16                o->m_uid = m_uid_store->insert( o );
17        }
18}
19
20void nv::root::object_destroyed( object* o )
21{
22        if ( m_lua_state && o->m_lua_index != lua::ref_none )
23        {
24                m_lua_state->unregister_object( o );
25        }
26        if ( m_uid_store && o->m_uid != 0 )
27        {
28                m_uid_store->remove( o->m_uid );
29        }
30}
Note: See TracBrowser for help on using the repository browser.