Fix crash caused by unregistered enum types
authorChris Adams <christopher.adams@nokia.com>
Fri, 25 May 2012 07:23:42 +0000 (17:23 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 28 May 2012 00:42:55 +0000 (02:42 +0200)
commitf62ab0a3dfaa873bb15cd1526f98f50a17228a9c
tree483c980f2d17eca24438e47e097bf1034d916daa
parent1deba22774e59458dc2e485f1cdf8f5b547d2941
Fix crash caused by unregistered enum types

If the enum type isn't registered with Q_ENUMS, the metatype lookup
fails, which results in a crash in certain circumstances.
This commit ensures that when assigning an undefined value to an
unregistered-enum-type property, no crash occurs.

Change-Id: I0b539b591c9c9d6262c748300e4f4b6813d4f9a6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/qml/qml/qqmlproperty.cpp
src/qml/qml/v8/qv8qobjectwrapper.cpp
tests/auto/qml/qqmlecmascript/data/enums.2.qml
tests/auto/qml/qqmlecmascript/testtypes.cpp
tests/auto/qml/qqmlecmascript/testtypes.h
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp