diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h
index a7bce83f5e807199d23a89f2380c155b940a0956..4eab97e920bd87b9b1ab8c0230e853cf8216d78f 100644
--- a/indra/llcommon/llmutex.h
+++ b/indra/llcommon/llmutex.h
@@ -96,6 +96,7 @@ class LLMutexLock
 	{
 		if (mMutex)
 			mMutex->unlock();
+		mMutex = nullptr;
 	}
 private:
 	LLMutex* mMutex;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index f69df0a981fe0fcd2df21fa9e60932bce5d85189..1687cde50f4468057c064caa85ceb152ad85deb0 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1173,7 +1173,7 @@ void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32
 
 void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
 { //could be called from any thread
-	std::unique_lock<LLMutex> header_lock(*mHeaderMutex);
+	LLMutexLock header_lock(mHeaderMutex);
 	mesh_header_map::iterator iter = mMeshHeader.find(mesh_params.getSculptID());
 	if (iter != mMeshHeader.end())
 	{ //if we have the header, request LOD byte range