QmlDesigner: Fixing double free

Calling detach() in setKey() will free the shared memory twice, if
we do not set m_memory to nullptr.
Clean cleanHandleInternal() does always return true, so
checking the value does not make sense.
We have to call cleanHandleInternal() immediately after the close.

Change-Id: I110693d1dd9dae4ff5e52cfd3fdd2f33137af969
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Thomas Hartmann
2016-11-29 16:53:03 +01:00
parent 337393ce97
commit 5eeecdb1b4
2 changed files with 7 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ public:
protected:
#ifdef Q_OS_UNIX
bool initKeyInternal();
bool cleanHandleInternal();
void cleanHandleInternal();
bool createInternal(QSharedMemory::AccessMode mode, int size);
bool attachInternal(QSharedMemory::AccessMode mode);
bool detachInternal();