diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2011-01-21 15:28:57 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-01-21 15:30:24 (GMT) |
commit | c17e49e8a481f96a4b953d8fcf41678fc1b2f9bc (patch) | |
tree | 21918e409c0198f4cb0fcaf6b4b67b1a25728fa6 | |
parent | 75771ddf96273899a990d33395fb4fac14666022 (diff) | |
download | Qt-c17e49e8a481f96a4b953d8fcf41678fc1b2f9bc.zip Qt-c17e49e8a481f96a4b953d8fcf41678fc1b2f9bc.tar.gz Qt-c17e49e8a481f96a4b953d8fcf41678fc1b2f9bc.tar.bz2 |
simplify QSharedMemory::detach()
de-init members in the QSharedMemoryPrivate::detach() like in code for symbian.
this gains a lightly better control in case of errors on detach()
Merge-request: 1018
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
-rw-r--r-- | src/corelib/kernel/qsharedmemory.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qsharedmemory_unix.cpp | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qsharedmemory_win.cpp | 1 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp index 2fd6c50..85b37d0 100644 --- a/src/corelib/kernel/qsharedmemory.cpp +++ b/src/corelib/kernel/qsharedmemory.cpp @@ -399,11 +399,7 @@ bool QSharedMemory::detach() return false; #endif - if (d->detach()) { - d->size = 0; - return true; - } - return false; + return d->detach(); } /*! diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp index bea5b63..3cd17f1 100644 --- a/src/corelib/kernel/qsharedmemory_unix.cpp +++ b/src/corelib/kernel/qsharedmemory_unix.cpp @@ -265,6 +265,7 @@ bool QSharedMemoryPrivate::detach() return false; } memory = 0; + size = 0; // Get the number of current attachments if (!handle()) diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp index 5293f45..ac9c86a 100644 --- a/src/corelib/kernel/qsharedmemory_win.cpp +++ b/src/corelib/kernel/qsharedmemory_win.cpp @@ -186,6 +186,7 @@ bool QSharedMemoryPrivate::detach() return false; } memory = 0; + size = 0; // close handle return cleanHandle(); |