diff options
| author | Victor Kareh <[email protected]> | 2026-09-08 16:49:51 -0400 |
|---|---|---|
| committer | Luke from DC <[email protected]> | 2026-09-14 19:50:25 +0000 |
| commit | 5aba4cf3447a3a6d44957107f8b0f75ddb1e71d5 (patch) | |
| tree | 8b113e6e06c4d7035b617b824daf0ad62748027c | |
| parent | 826106f69db88bb4c0685979ddccdfedcf77ca85 (diff) | |
| download | mate-panel-master.tar.bz2 mate-panel-master.tar.xz | |
When an applet crashes and the user clicks "Reload", the panel reads
pack-style data from the applet's widget after mate_panel_applet_clean()
has already destroyed it and freed the AppletInfo. Move the reads before
the clean call so everything is captured while the data is still valid,
otherwise this can crash the panel.
| -rw-r--r-- | mate-panel/panel-applet-frame.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mate-panel/panel-applet-frame.c b/mate-panel/panel-applet-frame.c index b175f787..dfea1e33 100644 --- a/mate-panel/panel-applet-frame.c +++ b/mate-panel/panel-applet-frame.c @@ -711,27 +711,29 @@ mate_panel_applet_frame_reload_response (GtkWidget *dialog, char *id = NULL; int position = -1; gboolean locked = FALSE; + PanelObjectPackType pack_type = PANEL_OBJECT_PACK_START; + int pack_idx = 0; panel = frame->priv->panel; iid = g_strdup (frame->priv->iid); + /* note: mate_panel_applet_clean() destroys the widget, which + * frees the AppletInfo, so everything needs to be read from + * info before calling it */ if (info) { + AppletData *applet_data; + id = g_strdup (info->id); position = mate_panel_applet_get_position (info); locked = panel_widget_get_applet_locked (panel, info->widget); - mate_panel_applet_clean (info); - } - AppletData *applet_data; - PanelObjectPackType pack_type = PANEL_OBJECT_PACK_START; - int pack_idx = 0; - - if (info) { applet_data = g_object_get_data (G_OBJECT (info->widget), MATE_PANEL_APPLET_DATA); if (applet_data) { pack_type = applet_data->pack_type; pack_idx = applet_data->pack_index; } + + mate_panel_applet_clean (info); } mate_panel_applet_frame_load (iid, panel, locked, |
