[llvm] r220251 - PR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK
David Blaikie
dblaikie at gmail.com
Mon Oct 20 17:34:39 PDT 2014
Author: dblaikie
Date: Mon Oct 20 19:34:39 2014
New Revision: 220251
URL: http://llvm.org/viewvc/llvm-project?rev=220251&view=rev
Log:
PR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK
Modified:
llvm/trunk/lib/Support/Windows/RWMutex.inc
Modified: llvm/trunk/lib/Support/Windows/RWMutex.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/RWMutex.inc?rev=220251&r1=220250&r2=220251&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/RWMutex.inc (original)
+++ llvm/trunk/lib/Support/Windows/RWMutex.inc Mon Oct 20 19:34:39 2014
@@ -84,12 +84,10 @@ RWMutexImpl::RWMutexImpl() {
}
RWMutexImpl::~RWMutexImpl() {
- if (sHasSRW) {
- // Nothing to do in the case of slim reader/writers
- } else {
+ if (!sHasSRW)
DeleteCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
- free(data_);
- }
+ // Nothing to do in the case of slim reader/writers except free the memory.
+ free(data_);
}
bool RWMutexImpl::reader_acquire() {
More information about the llvm-commits
mailing list