diff options
| author | korei999 <ju7t1xe@gmail.com> | 2025-02-02 01:38:47 +0200 | 
|---|---|---|
| committer | Leonardo Hernández Hernández <leohdz172@proton.me> | 2025-02-01 22:34:58 -0600 | 
| commit | aa69ed81b558f74e470e69cdcd442f9048ee624c (patch) | |
| tree | 01838cd22fdd914154d4e95d7fb953f6776ab6ea /dwl.c | |
| parent | d1c2f434983562bd7d2ace15ab0c05155be603bc (diff) | |
allocate with LISTEN_STATIC
Fixes: https://codeberg.org/dwl/dwl/issues/723
Supersedes: https://codeberg.org/dwl/dwl/pulls/724
Diffstat (limited to '')
| -rw-r--r-- | dwl.c | 5 | 
1 files changed, 4 insertions, 1 deletions
| @@ -79,7 +79,7 @@  #define END(A)                  ((A) + LENGTH(A))  #define TAGMASK                 ((1u << TAGCOUNT) - 1)  #define LISTEN(E, L, H)         wl_signal_add((E), ((L)->notify = (H), (L))) -#define LISTEN_STATIC(E, H)     do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0) +#define LISTEN_STATIC(E, H)     do { struct wl_listener *_l = ecalloc(1, sizeof(*_l)); _l->notify = (H); wl_signal_add((E), _l); } while (0)  /* enums */  enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */ @@ -906,6 +906,7 @@ commitpopup(struct wl_listener *listener, void *data)  	box.y -= (type == LayerShell ? l->scene->node.y : c->geom.y);  	wlr_xdg_popup_unconstrain_from_box(popup, &box);  	wl_list_remove(&listener->link); +	free(listener);  }  void @@ -1246,6 +1247,7 @@ destroydragicon(struct wl_listener *listener, void *data)  	focusclient(focustop(selmon), 1);  	motionnotify(0, NULL, 0, 0, 0, 0);  	wl_list_remove(&listener->link); +	free(listener);  }  void @@ -1255,6 +1257,7 @@ destroyidleinhibitor(struct wl_listener *listener, void *data)  	 * at this point the idle inhibitor is still in the list of the manager */  	checkidleinhibitor(wlr_surface_get_root_surface(data));  	wl_list_remove(&listener->link); +	free(listener);  }  void | 
