Changeset 266 for trunk/src/root.cc
- Timestamp:
- 06/19/14 03:49:49 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/root.cc
r265 r266 10 10 #include "nv/lua/lua_state.hh" 11 11 12 void 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 20 12 void nv::root::destroy_object( object* o ) 21 13 { 22 14 destroy_children( o ); 23 15 o->detach(); 24 if ( m_lua_state && o->m_lua_index != lua::ref::none )25 {26 m_lua_state->unregister_object( lua::ref( o->m_lua_index ) );27 }28 if ( m_uid_store && o->m_uid != 0 )29 {30 m_uid_store->remove( o->m_uid );31 }32 16 delete o; 33 17 } … … 40 24 } 41 25 } 42 43 void nv::root::register_with_lua( object* o, const char* lua_name, const char* storage )44 {45 if ( m_lua_state )46 {47 if ( lua_name != nullptr )48 {49 o->m_lua_index = m_lua_state->register_object( o, lua_name ).get();50 }51 if ( storage != nullptr )52 {53 o->m_lua_proto_index = m_lua_state->register_proto( o->get_id().c_str(), storage ).get();54 }55 }56 57 }58
Note: See TracChangeset
for help on using the changeset viewer.