mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
convert top objects to callbacks.free
This commit is contained in:
parent
ba47b49d88
commit
5ed38bfe0d
11
src/core.c
11
src/core.c
@ -681,6 +681,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
return NULL;
|
||||
}
|
||||
obj->callbacks.print = &print_top;
|
||||
obj->callbacks.free = &free_top;
|
||||
} else OBJ(addr, &update_net_stats)
|
||||
parse_net_stat_arg(obj, arg, free_at_crash);
|
||||
obj->callbacks.print = &print_addr;
|
||||
@ -1816,16 +1817,6 @@ void free_text_objects(struct text_object *root, int internal)
|
||||
}
|
||||
|
||||
switch (obj->type) {
|
||||
#ifdef __linux__
|
||||
case OBJ_top:
|
||||
case OBJ_top_mem:
|
||||
case OBJ_top_time:
|
||||
#ifdef IOSTATS
|
||||
case OBJ_top_io:
|
||||
#endif
|
||||
free_top(obj, internal);
|
||||
break;
|
||||
#endif /* __linux__ */
|
||||
#ifdef X11
|
||||
case OBJ_desktop:
|
||||
case OBJ_desktop_number:
|
||||
|
@ -1035,12 +1035,10 @@ void print_top(struct text_object *obj, char *p, int p_max_size)
|
||||
}
|
||||
}
|
||||
|
||||
void free_top(struct text_object *obj, int internal)
|
||||
void free_top(struct text_object *obj)
|
||||
{
|
||||
struct top_data *td = obj->data.opaque;
|
||||
|
||||
(void)internal;
|
||||
|
||||
if (!td)
|
||||
return;
|
||||
if (td->s)
|
||||
|
@ -143,7 +143,7 @@ struct process *get_process_by_name(const char *);
|
||||
|
||||
int parse_top_args(const char *s, const char *arg, struct text_object *obj);
|
||||
void print_top(struct text_object *, char *, int);
|
||||
void free_top(struct text_object *, int);
|
||||
void free_top(struct text_object *);
|
||||
|
||||
/* return zero on success, non-zero otherwise */
|
||||
int set_top_name_width(const char *);
|
||||
|
Loading…
Reference in New Issue
Block a user