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 3b53f8e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/private/dquickcontrolpalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
//
// 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"
#include "dqmlglobalobject_p_p.h"

#include <DGuiApplicationHelper>

Expand Down Expand Up @@ -937,7 +942,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 3b53f8e

Please sign in to comment.