diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-06-09 08:04:50 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-06-11 12:32:22 (GMT) |
commit | 9a16161889c7f6c15c4d5679148a28fe51f95abb (patch) | |
tree | 671eaeb57ebe611350e9e211dfc0c35ff40f0651 /src | |
parent | 3ff9474b8e3812f629869bc349ffb0a7f70c93a4 (diff) | |
download | Qt-9a16161889c7f6c15c4d5679148a28fe51f95abb.zip Qt-9a16161889c7f6c15c4d5679148a28fe51f95abb.tar.gz Qt-9a16161889c7f6c15c4d5679148a28fe51f95abb.tar.bz2 |
QMetaType: do not crash when registering builtin stream operator
It is not required to register builtin operator, but old code might
do so if a type was not builtin before.
This is the case of QVariant which became builtin only in Qt 4.7
Task-number: QTBUG-11316
Reviewed-by: Gabriel
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index ce9ed58..6ebaaa3 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -378,6 +378,8 @@ void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveO void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp, LoadOperator loadOp) { + if (idx < User) + return; //builtin types should not be registered; QVector<QCustomTypeInfo> *ct = customTypes(); if (!ct) return; |