Changeset 256 for trunk/src/lua


Ignore:
Timestamp:
06/14/14 21:06:00 (11 years ago)
Author:
epyon
Message:
  • various minor fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_state.cc

    r228 r256  
    383383{
    384384        if (!o) return;
     385        unregister_object( o->get_lua_index() );
     386}
     387
     388void lua::state::unregister_object( int index )
     389{
    385390        stack_guard guard( this );
    386         lua_rawgeti( m_state, LUA_REGISTRYINDEX, o->get_lua_index() );
     391        lua_rawgeti( m_state, LUA_REGISTRYINDEX, index );
    387392        lua_pushstring( m_state, "__ptr" );
    388393        lua_pushboolean( m_state, false );
    389394        lua_rawset( m_state, -3 );
    390395        lua_pop( m_state, 1 );
    391         luaL_unref( m_state, LUA_REGISTRYINDEX, o->get_lua_index() );
    392 }
     396        luaL_unref( m_state, LUA_REGISTRYINDEX, index );
     397}
     398
    393399
    394400void lua::state::deep_pointer_copy( int index, void* obj )
Note: See TracChangeset for help on using the changeset viewer.