02-10-2012, 02:05 AM
(02-10-2012, 01:44 AM)xoft Wrote: The main idea that I'm trying to implement is that the code doesn't get a direct cChunk pointer anywhere. Anyone asking for a chunk will get a shared pointer, and a valid one. This way there's no problem with a thread accessing a chunk when another thread has deleted it. However, it requires that all code checks the returned pointer whether the chunk is valid (loaded / generated) and act accordingly if it is not.
I thought I already did something like this, the cChunk_ptr class.