[QScintilla] QScintilla-1.72-gpl-2-snapshot-20070117 crashes example application under Qt4.2.2/VS8

KlausDre klausdre at googlemail.com
Sun Mar 4 13:50:54 GMT 2007


I am observing a crash when the example application coming with
QScintilla-1.72-gpl-2-snapshot-20070117 is starting up
(observed under Win2k w/ Qt4.2.2 and VS8).

The crash happens in Platform::DefaultFont(). A QByteArray is created
via QString.toAscii(). A pointer to the byte arrays data is returned,
but the array is deleted when the method exits.

I fixed the crash with the following patch:

--- PlatQt.cpp  2007-02-25 03:43:30.000000000 +0100
+++ ../PlatQt.cpp       2007-03-04 14:30:28.203125000 +0100
@@ -831,7 +831,9 @@

  const char *Platform::DefaultFont()
  {
-    return QApplication::font().family().toAscii();
+       static QByteArray defaultFont;
+       defaultFont = QApplication::font().family().toAscii();
+    return defaultFont;
  }

  int Platform::DefaultFontSize()




More information about the QScintilla mailing list