Index: trunk/src/engine/program_manager.cc
===================================================================
--- trunk/src/engine/program_manager.cc	(revision 474)
+++ trunk/src/engine/program_manager.cc	(revision 477)
@@ -16,5 +16,5 @@
 }
 
-nv::res_id nv::program_manager::load_resource( lua::table_guard& table )
+bool nv::program_manager::load_resource( lua::table_guard& table, shash64 id )
 {
 	NV_LOG_DEBUG( table.get_string("id") );
@@ -36,12 +36,11 @@
 	}
 
-	nv::program* program = new nv::program( m_context->get_device()->create_program( vsource, fsource ) );
-	return add( program );
+	add( m_context->get_device()->create_program( vsource, fsource ), id );
+	return true;
 }
 
-void nv::program_manager::release( program* p )
+void nv::program_manager::release( program p )
 {
-	m_context->get_device()->release( *p );
-	delete p;
+	m_context->get_device()->release( p );
 }
 
Index: trunk/src/engine/resource_system.cc
===================================================================
--- trunk/src/engine/resource_system.cc	(revision 474)
+++ trunk/src/engine/resource_system.cc	(revision 477)
@@ -9,5 +9,5 @@
 #include "nv/lua/lua_nova.hh"
 
-void nv::resource_manager_base::initialize( lua::state* a_lua_state )
+void nv::lua_resource_manager_base::initialize( lua::state* a_lua_state )
 {
 	m_lua = a_lua_state;
@@ -16,13 +16,12 @@
 }
 
-nv::res_id nv::resource_manager_base::load_resource( const string_view& id )
+bool nv::lua_resource_manager_base::load_resource( const string_view& id )
 {
 	lua::table_guard table( m_lua, lua::path( get_storage_name(), id ) );
-	res_id rid = load_resource( table );
-	if ( rid != 0 ) m_names[ id ] = rid;
-	return rid;
+	load_resource( table, id );
+	return true;
 }
 
-void nv::resource_manager_base::load_all()
+void nv::lua_resource_manager_base::load_all()
 {
 	clear();
@@ -31,7 +30,7 @@
 	for ( auto i : range( count ) )
 	{
-		lua::table_guard sub_table( table, i+1 );
-		res_id rid = load_resource( sub_table );
-		if ( rid != 0 ) m_names[ sub_table.get_string_hash_64("id") ] = rid;
+		lua::table_guard sub_table( table, i + 1 );
+		load_resource( sub_table, sub_table.get_string_hash_64( "id" ) );
 	}
 }
+
