cleanup default value on SIGUSR1
git-svn-id: http://tint2.googlecode.com/svn/trunk@421 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -37,15 +37,15 @@ PangoFontDescription *bat1_font_desc=0;
|
||||
PangoFontDescription *bat2_font_desc=0;
|
||||
struct batstate battery_state;
|
||||
int battery_enabled;
|
||||
int percentage_hide = 101;
|
||||
int percentage_hide;
|
||||
static timeout* battery_timeout=0;
|
||||
|
||||
static char buf_bat_percentage[10];
|
||||
static char buf_bat_time[20];
|
||||
|
||||
int8_t battery_low_status;
|
||||
unsigned char battery_low_cmd_send;
|
||||
char *battery_low_cmd=0;
|
||||
unsigned char battery_low_cmd_send=0;
|
||||
char *path_energy_now=0;
|
||||
char *path_energy_full=0;
|
||||
char *path_current_now=0;
|
||||
@@ -159,23 +159,37 @@ void init_battery()
|
||||
void cleanup_battery()
|
||||
{
|
||||
battery_enabled = 0;
|
||||
if (bat1_font_desc)
|
||||
pango_font_description_free(bat1_font_desc);
|
||||
if (bat2_font_desc)
|
||||
pango_font_description_free(bat2_font_desc);
|
||||
if (path_energy_now)
|
||||
g_free(path_energy_now);
|
||||
if (path_energy_full)
|
||||
g_free(path_energy_full);
|
||||
if (path_current_now)
|
||||
g_free(path_current_now);
|
||||
if (path_status)
|
||||
g_free(path_status);
|
||||
if (battery_low_cmd)
|
||||
g_free(battery_low_cmd);
|
||||
percentage_hide = 101;
|
||||
battery_low_cmd_send = 0;
|
||||
|
||||
battery_low_cmd = path_energy_now = path_energy_full = path_current_now = path_status = 0;
|
||||
bat1_font_desc = bat2_font_desc = 0;
|
||||
if (bat1_font_desc) {
|
||||
pango_font_description_free(bat1_font_desc);
|
||||
bat1_font_desc = 0;
|
||||
}
|
||||
if (bat2_font_desc) {
|
||||
pango_font_description_free(bat2_font_desc);
|
||||
bat2_font_desc = 0;
|
||||
}
|
||||
if (path_energy_now) {
|
||||
g_free(path_energy_now);
|
||||
path_energy_now = 0;
|
||||
}
|
||||
if (path_energy_full) {
|
||||
g_free(path_energy_full);
|
||||
path_energy_full = 0;
|
||||
}
|
||||
if (path_current_now) {
|
||||
g_free(path_current_now);
|
||||
path_current_now = 0;
|
||||
}
|
||||
if (path_status) {
|
||||
g_free(path_status);
|
||||
path_status = 0;
|
||||
}
|
||||
if (battery_low_cmd) {
|
||||
g_free(battery_low_cmd);
|
||||
battery_low_cmd = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user