Logging string in case of crash inside Qt text processing.

There are some crash reports from OS X 10.6 and it is the way
to find out which string exactly crashes the app in that place.
This commit is contained in:
John Preston 2017-01-16 13:18:34 +03:00
parent 4424dbf64a
commit 47aa03ce37
1 changed files with 6 additions and 0 deletions

View File

@ -330,6 +330,10 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi
}
QString part = str.mid(_from, length);
// Attempt to catch a crash in text processing
SignalHandlers::setCrashAnnotationRef("CrashString", &part);
QStackTextEngine engine(part, blockFont->f);
engine.itemize();
@ -340,6 +344,8 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi
BlockParser parser(&engine, this, minResizeWidth, _from, part);
layout.endLayout();
SignalHandlers::clearCrashAnnotationRef("CrashString");
}
}