Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/menu: prevent delayed pipe menu response on item destroy #2094

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

Consolatis
Copy link
Member

Without this patch we would happily access pipe_ctx->item members even if the item had been destroyed in the meantime.


Reproducer:

#!/usr/bin/bash

if test -n "$1"; then
	sleep $1
fi

cat << EOF
<openbox_pipe_menu>
	<menu id="delay-test-$(( RANDOM ))" label="Delay 3" execute="$(readlink -f "$0") 3" />
</openbox_pipe_menu>
EOF

and in menu.xml:

<menu id="root-menu">
  <menu id="delay" label="Delay" execute="~/.config/labwc/pipe_delay.sh" />
</menu>

Open the Delay menu, hover over Delay 3 and then press ESC before the 3 seconds have been elapsed.

Without this patch we would happily access `pipe_ctx->item`
members even if the item had been destroyed in the meantime.
@johanmalm
Copy link
Collaborator

LGTM. Excellent fix. Very much appreciated.

@johanmalm johanmalm merged commit 5ae9eed into labwc:master Aug 20, 2024
5 of 6 checks passed
Consolatis added a commit to Consolatis/labwc that referenced this pull request Aug 20, 2024
)

Without this patch we would happily access `pipe_ctx->item`
members even if the item had been destroyed in the meantime.
@Consolatis Consolatis deleted the fix/menu_destroy_ctx branch August 20, 2024 16:17
johanmalm pushed a commit that referenced this pull request Aug 20, 2024
Without this patch we would happily access `pipe_ctx->item`
members even if the item had been destroyed in the meantime.
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.

2 participants