From 01398f84244c0f4f06c8edb1e741937792f53eb2 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sun, 1 Jan 2012 16:20:52 +0000 Subject: Fixed the numchunks console command. Added some form of reference counting to cChunk to make sure it's not referenced when deleting it. Right now it's only needed due to the generation of chunks in a separate thread and adding it to the spread light list in cWorld git-svn-id: http://mc-server.googlecode.com/svn/trunk@161 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index fcf258bab..8555e01cf 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -100,6 +100,11 @@ public: static const int c_NumBlocks = 16*128*16; static const int c_BlockDataSize = c_NumBlocks * 2 + (c_NumBlocks/2); // 2.5 * numblocks + + // Reference counting + int AddReference( const char* a_Info = 0 ); // a_Info is for debugging + void RemoveReference( int a_ID = -1 ); + int GetReferenceCount(); private: struct sChunkState; sChunkState* m_pState; -- cgit v1.2.3