1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

free desktop information where it should be done

This commit is contained in:
Phil Sutter 2009-11-29 21:20:32 +01:00
parent 5ed38bfe0d
commit 3f00e817c5
4 changed files with 20 additions and 14 deletions

View File

@ -2394,6 +2394,10 @@ void clean_up(void *memtofree1, void* memtofree2)
info.first_process = NULL;
}
#ifdef X11
free_desktop_info();
#endif /* X11 */
free_text_objects(&global_root_object, 0);
if (tmpstring1) {
free(tmpstring1);

View File

@ -1803,6 +1803,8 @@ void free_text_objects(struct text_object *root, int internal)
{
struct text_object *obj;
(void)internal;
if (!root->prev) {
return;
}
@ -1817,20 +1819,7 @@ void free_text_objects(struct text_object *root, int internal)
}
switch (obj->type) {
#ifdef X11
case OBJ_desktop:
case OBJ_desktop_number:
case OBJ_desktop_name:
if(info.x11.desktop.name && !internal) {
free(info.x11.desktop.name);
info.x11.desktop.name = NULL;
}
if(info.x11.desktop.all_names && !internal) {
free(info.x11.desktop.all_names);
info.x11.desktop.all_names = NULL;
}
break;
#endif /* X11 */
default: break;
}
obj_free_loop_tail:
if(obj->sub) {

View File

@ -737,6 +737,18 @@ void print_desktop_name(struct text_object *obj, char *p, int p_max_size)
}
}
void free_desktop_info(void)
{
if(info.x11.desktop.name) {
free(info.x11.desktop.name);
info.x11.desktop.name = NULL;
}
if(info.x11.desktop.all_names) {
free(info.x11.desktop.all_names);
info.x11.desktop.all_names = NULL;
}
}
#ifdef OWN_WINDOW
/* reserve window manager space */
void set_struts(int sidenum)

View File

@ -99,6 +99,7 @@ void print_monitor_number(struct text_object *, char *, int);
void print_desktop(struct text_object *, char *, int);
void print_desktop_number(struct text_object *, char *, int);
void print_desktop_name(struct text_object *, char *, int);
void free_desktop_info(void);
#ifdef HAVE_XDBE
void xdbe_swap_buffers(void);