Improve safeness of QMetaType::registerType.
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>
Mon, 5 Mar 2012 14:40:03 +0000 (15:40 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Mar 2012 11:39:50 +0000 (12:39 +0100)
commite5dabe8338cb3dacf24079e315e07f2705fd0a70
tree555be08b6d9fa8b494d094ca524c564af97224ce
parent930a90d97835223587c2c8df1213c64295f3af97
Improve safeness of QMetaType::registerType.

This internal function is abused by some modules to create dynamic
types in metatype system. In Qt5 more non-optional arguments were added
to the function and to keep temporary source compatibility an overload
was created.

QMetaType code assumes that every known type has properly defined basic
operations like creation and destruction. Setting a helper function
pointer to null value is asking for a crash, because the code doesn't
check for that value, the null pointer may be called.

Change-Id: I5ca7454a70c308e01de26fab23481b3c94c22371
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
src/corelib/kernel/qmetatype.cpp