Fix null pointer call in QMetaType::destruct().
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>
Mon, 23 Jan 2012 15:34:50 +0000 (16:34 +0100)
committerQt by Nokia <qt-info@nokia.com>
Sun, 29 Jan 2012 14:21:01 +0000 (15:21 +0100)
Logic has a flow causing null pointer call during destruction of an
instance of a custom type in bootstrap mode.

The patch doesn't include autotests, because we do not test bootstrap
mode.

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

index e5fd8a5..a0a1295 100644 (file)
@@ -1546,8 +1546,10 @@ class TypeDestructor {
                 if (!qMetaTypeWidgetsHelper)
                     return;
                 dtor = qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].destructor;
-            } else
+            } else {
                 customTypeDestructor(type, where);
+                return;
+            }
             dtor(where);
         }
     };