mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
swaynag: call swaynag_destroy on clean exit
And fix the fallout of the swaynag_destroy having evolved without being tested: * wl_display_disconnect was called too early * `button_close` and `swaynag.details.button_details` needed to be heap allocated, since they are added to swaynag.buttons, and all entries of swaynag.buttons are freed in swaynag_destroy * To keep things simpler, disconnect the lifetime of the 'Toggle details' button text config setting from the button itself.
This commit is contained in:
parent
2f2cdd60de
commit
5e73acb431
4 changed files with 19 additions and 18 deletions
|
|
@ -243,8 +243,8 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,
|
|||
break;
|
||||
case 'L': // Detailed Button Text
|
||||
if (swaynag) {
|
||||
free(swaynag->details.button_details.text);
|
||||
swaynag->details.button_details.text = strdup(optarg);
|
||||
free(swaynag->details.details_text);
|
||||
swaynag->details.details_text = strdup(optarg);
|
||||
}
|
||||
break;
|
||||
case 'm': // Message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue