From bb5d287cc3eb68e1e46e5c3eb0a2c3991900354d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 16 Mar 2015 13:10:27 +0100 Subject: Windows: Don't cause a malloc before calling GetLastError() When creating a string it would cause a malloc which would reset GetLastError() so we need to ensure that GetLastError() is the first thing it calls if a Windows API call fails. Task-number: QTBUG-27765 Change-Id: I5cc4ce59aa1f03a0ec978fe54949a7931a225d52 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qsharedmemory_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qsharedmemory_p.h') diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h index 0308dde57f..2bcc0d4f6a 100644 --- a/src/corelib/kernel/qsharedmemory_p.h +++ b/src/corelib/kernel/qsharedmemory_p.h @@ -133,7 +133,7 @@ public: bool attach(QSharedMemory::AccessMode mode); bool detach(); - void setErrorString(const QString &function); + void setErrorString(QLatin1String function); #ifndef QT_NO_SYSTEMSEMAPHORE bool tryLocker(QSharedMemoryLocker *locker, const QString &function) { -- cgit v1.2.3