diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-05-25 10:01:21 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 02:13:38 +0200 |
commit | 1a93548e6b8095e211ea6ad8e074db4741b6801f (patch) | |
tree | f2abd41cfd80f732d7c7efc73a315554cc2d1a00 /src | |
parent | 723ae1c9502af30889e1edd5d0a2d5800bbd42d8 (diff) |
Ensure cached moduleName matches when avoiding conversion
Multiple plugins can have their module strings loaded at the same
logical address, so simple comparison of the string addresses fails
between multiple plugins.
Change-Id: If0bcbaaafa595e9581db1f3e480f7b1bffbae101
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 87c39b1859..416caa9c63 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -200,7 +200,9 @@ static QHashedString moduletoUtf8(const char *module) static const char *lastModule = 0; static QHashedString lastModuleStr; - if (lastModule != module) { + // Separate plugins may have different strings at the same address + QHashedCStringRef currentModule(module, ::strlen(module)); + if ((lastModule != module) || (lastModuleStr.hash() != currentModule.hash())) { lastModuleStr = QString::fromUtf8(module); lastModuleStr.hash(); lastModule = module; |