From f2849a020f825af3073f3eb9156c9a50b9783c90 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Wed, 24 Oct 2018 06:51:33 +0800 Subject: [PATCH] Fix qt warning Try to call deleteLater on a nullptr would cause qt print warning message: "QCoreApplication::notify: Unexpected null receiver" --- src/motionclipwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/motionclipwidget.cpp b/src/motionclipwidget.cpp index f76edd23..f728da59 100644 --- a/src/motionclipwidget.cpp +++ b/src/motionclipwidget.cpp @@ -47,7 +47,8 @@ void MotionClipWidget::setClip(SkeletonMotionClip clip) void MotionClipWidget::reload() { - m_reloadToWidget->deleteLater(); + if (nullptr != m_reloadToWidget) + m_reloadToWidget->deleteLater(); m_reloadToWidget = new QWidget(this); m_reloadToWidget->setContentsMargins(1, 0, 0, 0); m_reloadToWidget->setFixedSize(preferredSize());