[everything] Fix circular shared pointer references.
We had a cycle from transaction_manager <-> space_map, and also from the ref_counters back up to the tm. This prevented objects being destroyed when various programs exited. From now on we'll try and only use a shared ptr if ownership is implied. Otherwise a reference will be used (eg, for up pointers).
This commit is contained in:
		@@ -281,7 +281,7 @@ namespace {
 | 
			
		||||
		DamageTests()
 | 
			
		||||
			: bm_(create_bm<BLOCK_SIZE>(NR_BLOCKS)),
 | 
			
		||||
			  sm_(setup_core_map()),
 | 
			
		||||
			  tm_(new transaction_manager(bm_, sm_)) {
 | 
			
		||||
			  tm_(bm_, sm_) {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		virtual ~DamageTests() {}
 | 
			
		||||
@@ -315,7 +315,7 @@ namespace {
 | 
			
		||||
		with_temp_directory dir_;
 | 
			
		||||
		block_manager<>::ptr bm_;
 | 
			
		||||
		space_map::ptr sm_;
 | 
			
		||||
		transaction_manager::ptr tm_;
 | 
			
		||||
		transaction_manager tm_;
 | 
			
		||||
		thing_traits::ref_counter rc_;
 | 
			
		||||
 | 
			
		||||
		boost::optional<btree_layout> layout_;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user