Skip to content

action-manager: tie condition-changed handlers to the manager's lifetime - #3902

Open
Kioubit wants to merge 1 commit into
linuxmint:masterfrom
Kioubit:fix2
Open

Kioubit wants to merge 1 commit into
linuxmint:masterfrom
Kioubit:fix2

Conversation

@Kioubit

@Kioubit Kioubit commented Nov 20, 2026

Copy link
Copy Markdown

A NemoAction can outlive the NemoActionManager that connected to its "condition-changed" signal: actions are also referenced by the GtkActionGroups they are added to, and the manager itself is created per view, sidebar and window (nemo-view.c, nemo-places-sidebar.c,nemo-tree-sidebar.c) and finalized when those are destroyed.

The handler installed with g_signal_connect_swapped() is never dropped, so a later DBus owner change on a condition-gated action invokes the swapped callback with a destroyed manager.

Reproduce: open two Nemo windows, close one, then own the DBus name a custom action's condition watches:

Conditions=dbus com.example.DbusTest;
dbus-test-tool echo --session --name=com.example.DbusTest

With G_SLICE=always-malloc MALLOC_PERTURB_=165 nemo so the freed manager's memory cannot look valid, every run crashes at the emit above. After the patch the same sequence is clean and the remaining window's menu still
updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant