From 9ef4282e9e32e857f4d0cac9df6d58f2cba159f4 Mon Sep 17 00:00:00 2001 From: reinelt Date: Wed, 3 Mar 2004 03:47:04 +0000 Subject: [lcd4linux @ 2004-03-03 03:47:04 by reinelt] big patch from Martin Hejl: - use qprintf() where appropriate - save CPU cycles on gettimeofday() - add quit() functions to free allocated memory - fixed lots of memory leaks git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@384 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- plugin_i2c_sensors.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'plugin_i2c_sensors.c') diff --git a/plugin_i2c_sensors.c b/plugin_i2c_sensors.c index 812f676..151ea96 100644 --- a/plugin_i2c_sensors.c +++ b/plugin_i2c_sensors.c @@ -1,4 +1,4 @@ -/* $Id: plugin_i2c_sensors.c,v 1.12 2004/02/16 08:19:44 reinelt Exp $ +/* $Id: plugin_i2c_sensors.c,v 1.13 2004/03/03 03:47:04 reinelt Exp $ * * I2C sensors plugin * @@ -23,6 +23,13 @@ * * * $Log: plugin_i2c_sensors.c,v $ + * Revision 1.13 2004/03/03 03:47:04 reinelt + * big patch from Martin Hejl: + * - use qprintf() where appropriate + * - save CPU cycles on gettimeofday() + * - add quit() functions to free allocated memory + * - fixed lots of memory leaks + * * Revision 1.12 2004/02/16 08:19:44 reinelt * i2c_sensors patch from Xavier * @@ -368,8 +375,9 @@ int plugin_init_i2c_sensors (void) debug("if i2c_sensors doesn't work, double check this value !"); path = realloc(path, strlen(path_cfg)+1); strcpy(path, path_cfg); - free(path_cfg); + } + free(path_cfg); // we activate the function only if there's a possibly path found if (path!=NULL) { @@ -386,3 +394,8 @@ int plugin_init_i2c_sensors (void) return 0; } + +void plugin_exit_i2c_sensors(void) +{ + hash_destroy(&I2Csensors); +} -- cgit v1.2.3