From 0fb12cf952a6623c3d5d0594fc7cdfd08849fd2f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 Mar 2017 11:32:32 +0200 Subject: [PATCH] feat(src/app/object-builders/AsyncObjectBuilder): add assertions --- .../src/app/object-builders/AsyncObjectBuilder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linphone-desktop/src/app/object-builders/AsyncObjectBuilder.cpp b/linphone-desktop/src/app/object-builders/AsyncObjectBuilder.cpp index fcdf32923..1ba0462de 100644 --- a/linphone-desktop/src/app/object-builders/AsyncObjectBuilder.cpp +++ b/linphone-desktop/src/app/object-builders/AsyncObjectBuilder.cpp @@ -33,11 +33,12 @@ using namespace std; class AsyncObjectBuilder::ObjectIncubator : public QQmlIncubator { public: // FIXME: At this moment, asynchronous loading is unstable. - // Use `IncubationMode::Synchronous` instead in Qt 5.9. + // In the future, use `IncubationMode::Asynchronous` instead in Qt 5.9. // // See: https://bugreports.qt.io/browse/QTBUG-49416 and // https://bugreports.qt.io/browse/QTBUG-50992 ObjectIncubator (AsyncObjectBuilder *builder) : QQmlIncubator(IncubationMode::Synchronous) { + Q_ASSERT(builder != nullptr); m_builder = builder; } @@ -63,6 +64,9 @@ protected: m_builder->m_object = object; emit m_builder->objectCreated(object); + Q_ASSERT(m_builder->m_component != nullptr); + Q_ASSERT(m_builder->m_incubator != nullptr); + // Optimization: Delete unused component now. m_builder->m_component->deleteLater();