diff options
| author | bakkeby <[email protected]> | 2020-08-10 11:36:10 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-08-10 11:36:10 +0200 |
| commit | e5ea493d3299caad340ecbd6ef7a6fd563224f43 (patch) | |
| tree | 5ce91fee65e136bb87117f07ce4c99a40273ed50 | |
| parent | dfe1c405630ab912501d5bb841a3fc34738a515c (diff) | |
| download | dwm-flexipatch-e5ea493d3299caad340ecbd6ef7a6fd563224f43.tar.gz dwm-flexipatch-e5ea493d3299caad340ecbd6ef7a6fd563224f43.zip | |
systray: systray window may always not exist depending on configuration and number of monitors available, causing segfault in cleanup. Fixing double free on freeing fonts.
| -rw-r--r-- | dwm.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -962,7 +962,6 @@ cleanup(void) Layout foo = { "", NULL }; Monitor *m; size_t i; - view(&a); selmon->lt[selmon->sellt] = &foo; for (m = mons; m; m = m->next) @@ -972,9 +971,11 @@ cleanup(void) while (mons) cleanupmon(mons); #if BAR_SYSTRAY_PATCH - if (showsystray) { - XUnmapWindow(dpy, systray->win); - XDestroyWindow(dpy, systray->win); + if (showsystray && systray) { + if (systray->win) { + XUnmapWindow(dpy, systray->win); + XDestroyWindow(dpy, systray->win); + } free(systray); } #endif // BAR_SYSTRAY_PATCH @@ -988,11 +989,6 @@ cleanup(void) free(scheme[i]); free(scheme); XDestroyWindow(dpy, wmcheckwin); - #if BAR_PANGO_PATCH - drw_font_free(drw->font); - #else - drw_fontset_free(drw->fonts); - #endif // BAR_PANGO_PATCH drw_free(drw); XSync(dpy, False); XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); |
