From: Matthew Vogt Date: Fri, 25 May 2012 00:01:21 +0000 (+1000) Subject: Ensure cached moduleName matches when avoiding conversion X-Git-Tag: 071012131707~299 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a93548e6b8095e211ea6ad8e074db4741b6801f;p=profile%2Fivi%2Fqtdeclarative.git 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 --- diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 87c39b1..416caa9 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;