This looks a bit strange. Feel like this should be a shared_ptr or similar if you are sharing a critical section with something.