Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dc26d15
)
Don't leak font memory when setting up the bar a subsequent time
author
Marco Peereboom
<marco@conformal.com>
Wed, 7 Jul 2010 12:52:42 +0000
(12:52 +0000)
committer
Marco Peereboom
<marco@conformal.com>
Wed, 7 Jul 2010 12:52:42 +0000
(12:52 +0000)
scrotwm.c
patch
|
blob
|
history
diff --git
a/scrotwm.c
b/scrotwm.c
index
49dec92
..
d04ecca
100644
(file)
--- a/
scrotwm.c
+++ b/
scrotwm.c
@@
-922,6
+922,11
@@
bar_setup(struct swm_region *r)
{
int i;
{
int i;
+ if (bar_fs) {
+ XFreeFont(display, bar_fs);
+ bar_fs = NULL;
+ }
+
for (i = 0; bar_fonts[i] != NULL; i++) {
bar_fs = XLoadQueryFont(display, bar_fonts[i]);
if (bar_fs) {
for (i = 0; bar_fonts[i] != NULL; i++) {
bar_fs = XLoadQueryFont(display, bar_fonts[i]);
if (bar_fs) {
@@
-931,6
+936,9
@@
bar_setup(struct swm_region *r)
}
if (bar_fonts[i] == NULL)
errx(1, "couldn't load font");
}
if (bar_fonts[i] == NULL)
errx(1, "couldn't load font");
+ if (bar_fs == NULL)
+ errx(1, "couldn't create font structure");
+
bar_height = bar_fs->ascent + bar_fs->descent + 3;
r->bar_window = XCreateSimpleWindow(display,
bar_height = bar_fs->ascent + bar_fs->descent + 3;
r->bar_window = XCreateSimpleWindow(display,