mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-04 13:08:31 +00:00
Fix segfault in X11-related code
Conky sometimes tries to clears part of a window before it's created, this breaks closing the displaying. For example with this config: TEXT $lua
This commit is contained in:
parent
b85b0d5aab
commit
567a86f99a
10
src/conky.c
10
src/conky.c
@ -3987,10 +3987,12 @@ void clean_up(void *memtofree1, void* memtofree2)
|
||||
}
|
||||
#ifdef X11
|
||||
if (x_initialised == YES) {
|
||||
XClearArea(display, window.window, text_start_x - window.border_inner_margin - window.border_outer_margin - window.border_width,
|
||||
text_start_y - window.border_inner_margin - window.border_outer_margin - window.border_width,
|
||||
text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2,
|
||||
text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2, 0);
|
||||
if(window_created == 1) {
|
||||
XClearArea(display, window.window, text_start_x - window.border_inner_margin - window.border_outer_margin - window.border_width,
|
||||
text_start_y - window.border_inner_margin - window.border_outer_margin - window.border_width,
|
||||
text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2,
|
||||
text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2, 0);
|
||||
}
|
||||
destroy_window();
|
||||
free_fonts();
|
||||
if(x11_stuff.region) {
|
||||
|
@ -64,6 +64,7 @@ int workarea[4];
|
||||
|
||||
/* Window stuff */
|
||||
struct conky_window window;
|
||||
char window_created = 0;
|
||||
|
||||
/* local prototypes */
|
||||
static void update_workarea(void);
|
||||
@ -215,6 +216,7 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
|
||||
* happens but I bet the bug is somewhere here. */
|
||||
set_transparent = set_trans;
|
||||
background_colour = back_colour;
|
||||
window_created = 1;
|
||||
|
||||
#ifdef OWN_WINDOW
|
||||
if (own_window) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user