Changeset 257 for trunk/src/root.cc
- Timestamp:
- 06/14/14 22:40:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/root.cc
r256 r257 18 18 } 19 19 20 void nv::root:: object_destroyed( object* o )20 void nv::root::destroy_object( object* o ) 21 21 { 22 destroy_children( o ); 23 o->detach(); 22 24 if ( m_lua_state && o->m_lua_index != lua::ref_none ) 23 25 { … … 28 30 m_uid_store->remove( o->m_uid ); 29 31 } 32 if ( o != this) delete o; 30 33 } 34 35 void nv::root::destroy_children( object* o ) 36 { 37 while ( !o->m_children.empty() ) 38 { 39 destroy_object( o->m_children.front() ); 40 } 41 } 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 ); 50 } 51 if ( storage != nullptr ) 52 { 53 o->m_lua_proto_index = m_lua_state->register_proto( o, storage ); 54 } 55 } 56 57 } 58
Note: See TracChangeset
for help on using the changeset viewer.