summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-21 17:18:38 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-21 17:18:38 (GMT)
commit015d7cd6d0d2bd22a74ee1b06e703eb876336bec (patch)
tree812e4c3ed07a8e0214fc0306c6a6c85937e30487 /src/corelib/plugin/qlibrary.cpp
parent084a32add3ae8f2976ff0c164b49170484a34bc4 (diff)
downloadQt-015d7cd6d0d2bd22a74ee1b06e703eb876336bec.zip
Qt-015d7cd6d0d2bd22a74ee1b06e703eb876336bec.tar.gz
Qt-015d7cd6d0d2bd22a74ee1b06e703eb876336bec.tar.bz2
Fix crash at program exit: Q_GLOBAL_STATIC is zeroed.
When libraryData() is 0, &libraryData()->map is 0x4. So make sure we return 0 if libraryData() is null too. Reviewed-by: TrustMe
Diffstat (limited to 'src/corelib/plugin/qlibrary.cpp')
-rw-r--r--src/corelib/plugin/qlibrary.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 5cf6513..51b3a50 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -436,7 +436,8 @@ Q_GLOBAL_STATIC(LibraryData, libraryData)
static LibraryMap *libraryMap()
{
- return &(libraryData()->libraryMap);
+ LibraryData *data = libraryData();
+ return data ? &data->libraryMap : 0;
}
QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString &version)