Skip to content

Commit

Permalink
fix: crashed on palette destroyed
Browse files Browse the repository at this point in the history
do not set value if app is about to quit
Issue: linuxdeepin/dtk#193
  • Loading branch information
kegechen committed Oct 22, 2024
1 parent c4b6f6b commit a4a4640
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/private/dquickcontrolpalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#define protected public
#include <private/qcoreapplication_p.h>
#undef protected

#include "dquickcontrolpalette_p.h"
#include "dquickglobal_p.h"

Expand Down Expand Up @@ -937,7 +941,9 @@ void DQuickControlColorSelector::notifyColorPropertyChanged()

void DQuickControlColorSelector::updatePropertyFromName(const QByteArray &name, const DQuickControlPalette *palette)
{
if (QCoreApplication::closingDown())
auto appriv = static_cast<QCoreApplicationPrivate*>(qApp->QCoreApplication::d_ptr.data());
Q_ASSERT(appriv);
if (QCoreApplication::closingDown() || !appriv || appriv->aboutToQuitEmitted)
return;
Q_ASSERT(!name.isEmpty());
QColor color;
Expand Down

0 comments on commit a4a4640

Please sign in to comment.