st/entry: Fix leak when copying or cutting text using shortcuts
clutter_text_get_selection() creates a copy of the selected text which
gets passed to st_clipboard_set_text() which creates its own copy. The
copy returned by clutter_text_get_selection() however never got free'd.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1306
(cherry picked from commit fdfcacf1db
)
This commit is contained in:
parent
ff73f76527
commit
b2454bd1b2
@ -679,6 +679,8 @@ st_entry_key_press_event (ClutterActor *actor,
|
|||||||
ST_CLIPBOARD_TYPE_CLIPBOARD,
|
ST_CLIPBOARD_TYPE_CLIPBOARD,
|
||||||
text);
|
text);
|
||||||
|
|
||||||
|
g_free (text);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,6 +707,8 @@ st_entry_key_press_event (ClutterActor *actor,
|
|||||||
clutter_text_delete_selection ((ClutterText *) priv->entry);
|
clutter_text_delete_selection ((ClutterText *) priv->entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (text);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user