[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kxmlgui] src: KHelpMenu: mDonateAction is already parented to the KHelpMenu.
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2016-06-18 14:29:14
Message-ID: E1bEHFK-0004rn-Le () code ! kde ! org
[Download RAW message or body]

Git commit 6ad6b446538d9e3055edf789ef2c062cdb30093f by Andreas Hartmetz.
Committed on 18/06/2016 at 14:25.
Pushed by ahartmetz into branch 'master'.

KHelpMenu: mDonateAction is already parented to the KHelpMenu.

Don't delete it manually. This fixes a crash during shutdown of
KMix.
This would be just unnecessary if the action was actually
deleted during destruction of the parent set in the constructor,
which happens later, but according to valgrind, at least in KMix
the action is reparented to and deleted by some action collection
that is cleared earlier. "If you take it, it's yours."

M  +2    -2    src/khelpmenu.cpp

http://commits.kde.org/kxmlgui/6ad6b446538d9e3055edf789ef2c062cdb30093f

diff --git a/src/khelpmenu.cpp b/src/khelpmenu.cpp
index d1a11f5..6442846 100644
--- a/src/khelpmenu.cpp
+++ b/src/khelpmenu.cpp
@@ -78,7 +78,6 @@ public:
         delete mAboutApp;
         delete mAboutKDE;
         delete mBugReport;
-        delete mDonateAction;
         delete mSwitchApplicationLanguage;
     }
 
@@ -147,7 +146,8 @@ void KHelpMenuPrivate::createActions(KHelpMenu *q)
         mReportBugAction = KStandardAction::reportBug(q, SLOT(reportBug()), q);
     }
 
-    if (KAuthorized::authorizeKAction(QStringLiteral("help_donate")) && \
mAboutData.bugAddress() == QStringLiteral("submit@bugs.kde.org")) { +    if \
(KAuthorized::authorizeKAction(QStringLiteral("help_donate")) +        && \
mAboutData.bugAddress() == QStringLiteral("submit@bugs.kde.org")) {  mDonateAction = \
new QAction(i18n("&Donate"), q);  \
                mDonateAction->setObjectName(QStringLiteral("help_donate"));
         QObject::connect(mDonateAction, &QAction::triggered, q, &KHelpMenu::donate);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic