summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
diff options
context:
space:
mode:
authorMurray Read <ext-murray.2.read@nokia.com>2012-03-15 15:41:25 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-03-15 18:50:37 (GMT)
commitfde8259dd8844410f878fe97db38979cc4c6f56a (patch)
treed1687bcc7e283f7505d690f3006a4cb5dfba846e /src/corelib/codecs
parente8c806793ad77ab8abe2bda855628257ec04b8b5 (diff)
downloadQt-fde8259dd8844410f878fe97db38979cc4c6f56a.zip
Qt-fde8259dd8844410f878fe97db38979cc4c6f56a.tar.gz
Qt-fde8259dd8844410f878fe97db38979cc4c6f56a.tar.bz2
Crash in Symbian text codec creation without CleanupStack
The Symbian text codec is creating a CCnvCharacterSetConverter with its NewL() function. This requires the CleanupStack, otherwise you get a E32USER-CBase 69 panic. But sometimes apps have been using text streams and other objects in static data construction or destruction which use the text codec where there is no CleanupStack. This change detects is a CleanupStack is present and temporarily creates one if not. Change-Id: Ia68fa60b4f0e3d675ee302208a625c6e9493a6f1 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r--src/corelib/codecs/qtextcodec_symbian.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/codecs/qtextcodec_symbian.cpp b/src/corelib/codecs/qtextcodec_symbian.cpp
index 1b09ec4..e1eb336 100644
--- a/src/corelib/codecs/qtextcodec_symbian.cpp
+++ b/src/corelib/codecs/qtextcodec_symbian.cpp
@@ -167,8 +167,12 @@ Q_GLOBAL_STATIC(QThreadStorage<CCnvCharacterSetConverter *>,gs_converterStore);
CCnvCharacterSetConverter *QSymbianTextCodec::converter()
{
CCnvCharacterSetConverter *&conv = gs_converterStore()->localData();
- if (!conv)
+ if (!conv) {
+ QScopedPointer<CTrapCleanup> trap;
+ if (!User::TrapHandler())
+ trap.reset(CTrapCleanup::New());
QT_TRAP_THROWING(conv = CCnvCharacterSetConverter::NewL())
+ }
return conv;
}