! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Avoid double free due to menu destroying
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Libxfce4panel

Comments

Description Viktor Odintsev editbugs 2017-03-30 01:48:24 CEST
Created attachment 7064 
Patch

Steps to reproduce:

1. Add a new item (pulseaudio-plugin is a good option)
2. Delete this item
3. A critical message appears in stderr

The message is "gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed".

This happens because library tries to destroy already destroyed menu. It's destroyed automatically by panel widget because the menu was attached to this widget before. Detaching the menu will destroy it as well.

Attached menu should be destroyed using gtk_menu_detach when it necessary. It also should never be destroyed manually after destroying the widget to which menu was attached.

The attached patch fixes this issue.

https://git.xfce.org/xfce/xfce4-panel/commit/?id=2e1196498e908d31a6c3983304f5019c3b481327
Comment 2 Git Bot editbugs 2017-10-27 16:32:35 CEST
Viktor Odintsev referenced this bugreport in commit 0472ee774e5f0a700abbcdf87d09c22b40b69e13

Fix menu leak, attach menu to button (Bug #13466)

https://git.xfce.org/xfce/xfce4-power-manager/commit?id=0472ee774e5f0a700abbcdf87d09c22b40b69e13

Bug #13466

Reported by:
Viktor Odintsev
Reported on: 2017-03-30
Last modified on: 2017-10-27

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Version:
Unspecified

Attachments

Patch (1.27 KB, patch)
2017-03-30 01:48 CEST , Viktor Odintsev
no flags

Additional information