| Summary: | KDE Daemon (kded4), signal SIGSEGV | ||
|---|---|---|---|
| Product: | [Unmaintained] khotkeys | Reporter: | Stefan Usenbinz <usenbinz> |
| Component: | general | Assignee: | Lubos Lunak <l.lunak> |
| Status: | CLOSED FIXED | ||
| Severity: | crash | CC: | kde, uwolfer |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Stefan Usenbinz
2008-09-20 13:39:36 UTC
Two things come to my mind that could cause a double deletion in the Settings destructor.
1. Settings::setActions should check for self-assignment of m_actions
delete m_actions;
m_actions = actions;
When actions happens to be the same pointer as m_actions (e.g. due to something along the lines of settings.setActions(settings.actions())) m_actions will point to a deleted object on exit of setActions. Deleting m_actions in the destructor then causes a double deletion and therefore a crash.
This is safer:
if (actions!=m_actions)
{
delete m_actions;
m_actions = actions;
}
Btw.: setGesturesExclude has a similar deficiency
2. KHotKeysModule::reread_configuration() gets a copy of the actions pointer:
actions_root = _settings.actions();
and the KHotKeysModule destructor deletes it:
delete actions_root;
Then _settings destructor is invoked and since actions_root pointed to the same object as _settings.m_actions Settings destructor tries to delete an already deleted object.
If KHotKeysModule really needs actions_root (instead of using _settings.actions() which could be an inline getter in case performance is a concern) it should either claim ownership or not delete the ActionDataGroup.
Solved with 863007 |