Summary: | Dolphin crashes when entering selection mode with spacebar repeatedly. | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Fabian Vogt <fabian> |
Component: | Selection Mode | Assignee: | KFM Developers <kfm-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | 6ojii7fe, bugseforuns, felixernst |
Priority: | NOR | ||
Version First Reported In: | 25.08.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/system/dolphin/-/commit/9a0b5030293a68a75fe057a454e0332b434d3163 | Version Fixed In: | |
Sentry Crash Report: |
Description
Fabian Vogt
2025-08-23 16:51:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/1029 Git commit fb4a4eb1884da2192bf17ab4f92f2ff01f531044 by Felix Ernst. Committed on 07/09/2025 at 20:47. Pushed by felixernst into branch 'master'. Fix crash between selection mode and folder icon chooser Opening selection mode twice with a single folder selected causes a crash. SetFolderIconItemAction expects its widget to be destroyed but the SelectionMode::BottomBar code path keeps it alive, so the second call to QWidgetAction::createWidget() of the folder icon chooser crashes because the previously created widget still has a parent. This small check fixes the crash. Contrarily, the regular context menu does destroy the actions on hide, so no crash happens there. An alternative fix to what was implemented in this commit could look at the lifetime handling of the SelectionMode::BottomBar implementation. Its BottomBarContentsContainer is never destroyed, BottomBarContentsContainer::contextActionsFor does not set lifetimes on contextActions, or destroys its actions on hide. However, fixing this here in QWidgetAction::createWidget() also makes sense because the related QWidgetAction::requestWidget() method transfers ownership to the caller. It's not part of this API to expect the caller to delete the widget immediately. On the contrary QWidgetAction::requestWidget(QWidget *parent) is typically expected to be callable e.g. by toolbars as well where the action will persist indefinitely. M +3 -1 src/itemactions/setfoldericonitemaction.cpp https://invent.kde.org/system/dolphin/-/commit/fb4a4eb1884da2192bf17ab4f92f2ff01f531044 Git commit 9a0b5030293a68a75fe057a454e0332b434d3163 by Felix Ernst. Committed on 07/09/2025 at 20:51. Pushed by felixernst into branch 'release/25.08'. Fix crash between selection mode and folder icon chooser Opening selection mode twice with a single folder selected causes a crash. SetFolderIconItemAction expects its widget to be destroyed but the SelectionMode::BottomBar code path keeps it alive, so the second call to QWidgetAction::createWidget() of the folder icon chooser crashes because the previously created widget still has a parent. This small check fixes the crash. Contrarily, the regular context menu does destroy the actions on hide, so no crash happens there. An alternative fix to what was implemented in this commit could look at the lifetime handling of the SelectionMode::BottomBar implementation. Its BottomBarContentsContainer is never destroyed, BottomBarContentsContainer::contextActionsFor does not set lifetimes on contextActions, or destroys its actions on hide. However, fixing this here in QWidgetAction::createWidget() also makes sense because the related QWidgetAction::requestWidget() method transfers ownership to the caller. It's not part of this API to expect the caller to delete the widget immediately. On the contrary QWidgetAction::requestWidget(QWidget *parent) is typically expected to be callable e.g. by toolbars as well where the action will persist indefinitely. (cherry picked from commit fb4a4eb1884da2192bf17ab4f92f2ff01f531044) fa8ba3b5 Fix crash of folder icon chooser in selection mode Co-authored-by: Felix Ernst <felixernst@kde.org> M +3 -1 src/itemactions/setfoldericonitemaction.cpp https://invent.kde.org/system/dolphin/-/commit/9a0b5030293a68a75fe057a454e0332b434d3163 *** Bug 509956 has been marked as a duplicate of this bug. *** Hi, I saw in the commit that this fix was was in commit release/25.08 I'm running dolphin 25.08.0 according to dolphin --version and this bug still occurs. Am I missing something here? Sorry, I'm new to Linux. |