mirror of
https://github.com/mintycube/dmenu.git
synced 2024-10-22 12:05:48 +00:00
Fix memory leaks in drw
Synced from dwm. Patch by Alex Flierl <shad0w73@freenet.de>, thanks. (upgrade to 1df960, 2020-06-11)
This commit is contained in:
parent
419de40e2c
commit
c4cac2c195
@ -1,4 +1,4 @@
|
|||||||
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this dmenu 4.9 (750b30, 2019-03-03) project has a different take on patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
|
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this dmenu 4.9 (1df960, 2020-06-11) project has a different take on patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
|
||||||
|
|
||||||
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dmenu-flexipatch/blob/master/patches.def.h):
|
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dmenu-flexipatch/blob/master/patches.def.h):
|
||||||
```c
|
```c
|
||||||
|
5
drw.c
5
drw.c
@ -114,6 +114,11 @@ drw_free(Drw *drw)
|
|||||||
{
|
{
|
||||||
XFreePixmap(drw->dpy, drw->drawable);
|
XFreePixmap(drw->dpy, drw->drawable);
|
||||||
XFreeGC(drw->dpy, drw->gc);
|
XFreeGC(drw->dpy, drw->gc);
|
||||||
|
#if PANGO_PATCH
|
||||||
|
drw_font_free(drw->font);
|
||||||
|
#else
|
||||||
|
drw_fontset_free(drw->fonts);
|
||||||
|
#endif // PANGO_PATCH
|
||||||
free(drw);
|
free(drw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user