Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.9.7
-
None
-
-
cbac5a1a6edfd0d7a1e351bbe50bab118d1155e5
Description
In Windows version of QLocalSocket (qlocalsocket_win.cpp), whenever error occurs, error is recorded by calling setErrorString(QLatin1String(...)) and GetLastError() is called in the setErrorString() function to determine the type of the error.
But, as QLatin1String(...) may cause system call (for memory allocation, I guess), that GetLastError() will no longer return the original error code (instead, returns ERROR_SUCCESS for the memory allocation system call). As a result, QLocalSocketPrivate::_q_winError() sets error = QLocalSocket::UnknownSocketError regardless of the original error type. And, when QLocalSocket::error() is called later, I get QLocalSocket::UnknownSocketError.