Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1
-
None
-
Windows XP 32, MSVC 2010
-
f2a40fa07123748ece2fc93790345379f15ef07f
Description
During termination my program causes access violation trying to read at nullptr when I call
QTextStream(stdout) << ... << endl;
from within my global object's destructor.
The problem is here:
void QTextStreamPrivate::flushWriteBuffer()
{
...
if (!codec)}}
codec = QTextCodec::codecForLocale();
Since here you just assume codec is not nullptr and access it like this:
QByteArray data = codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState);
but QTextCodec::codecForLocale() may have returned nullptr if some internal Qt global data is already destroyed (destroyed before my global object) and if this is the case codec stays nullptr.
Attachments
Issue Links
- relates to
-
QTBUG-38496 Windows: Null pointer dereference in QTextStream.cpp caused by QTextCodec::codecForLocale() returning 0 when running an ICU-build under Cygwin
-
- Closed
-