mirror of
https://github.com/NickHu/sway
synced 2024-12-28 22:23:30 +01:00
Fix memleak in container_get_box
Rather than allocate a structure and expect callers to free it, take a pointer to an existing struct as an argument. This function is no longer called anywhere though.
This commit is contained in:
parent
be86d3aba6
commit
8773ed3970
2 changed files with 2 additions and 4 deletions
|
@ -295,6 +295,6 @@ bool container_is_floating(struct sway_container *container);
|
||||||
/**
|
/**
|
||||||
* Get a container's box in layout coordinates.
|
* Get a container's box in layout coordinates.
|
||||||
*/
|
*/
|
||||||
struct wlr_box *container_get_box(struct sway_container *container);
|
void container_get_box(struct sway_container *container, struct wlr_box *box);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -988,11 +988,9 @@ bool container_is_floating(struct sway_container *container) {
|
||||||
return container->parent == workspace->sway_workspace->floating;
|
return container->parent == workspace->sway_workspace->floating;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_box *container_get_box(struct sway_container *container) {
|
void container_get_box(struct sway_container *container, struct wlr_box *box) {
|
||||||
struct wlr_box *box = calloc(1, sizeof(struct wlr_box));
|
|
||||||
box->x = container->x;
|
box->x = container->x;
|
||||||
box->y = container->y;
|
box->y = container->y;
|
||||||
box->width = container->width;
|
box->width = container->width;
|
||||||
box->height = container->height;
|
box->height = container->height;
|
||||||
return box;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue