aboutsummaryrefslogtreecommitdiffstats
path: root/widget_text.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-03 03:47:04 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-03 03:47:04 +0000
commit9ef4282e9e32e857f4d0cac9df6d58f2cba159f4 (patch)
tree723676ea31fe0615b4d0caca1491e5a21fe85c7a /widget_text.c
parentd0b39b590e56b191394cfcb6b8690de0fbd87957 (diff)
downloadlcd4linux-9ef4282e9e32e857f4d0cac9df6d58f2cba159f4.tar.gz
[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
Diffstat (limited to 'widget_text.c')
-rw-r--r--widget_text.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/widget_text.c b/widget_text.c
index a936feb..3b413fc 100644
--- a/widget_text.c
+++ b/widget_text.c
@@ -1,4 +1,4 @@
-/* $Id: widget_text.c,v 1.13 2004/02/18 06:39:20 reinelt Exp $
+/* $Id: widget_text.c,v 1.14 2004/03/03 03:47:04 reinelt Exp $
*
* simple text widget handling
*
@@ -21,6 +21,13 @@
*
*
* $Log: widget_text.c,v $
+ * Revision 1.14 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.13 2004/02/18 06:39:20 reinelt
* T6963 driver for graphic displays finished
*
@@ -381,12 +388,18 @@ int widget_text_init (WIDGET *Self)
int widget_text_quit (WIDGET *Self) {
-
- if (Self->data) {
- free (Self->data);
- Self->data=NULL;
+ WIDGET_TEXT *Text;
+ if (Self) {
+ Text=Self->data;
+ if (Self->data) {
+ if (Text->preval) free(Text->preval);
+ if (Text->postval) free(Text->postval);
+ if (Text->value) free(Text->value);
+ if (Text->buffer) free(Text->buffer);
+ free (Self->data);
+ Self->data=NULL;
+ }
}
-
return 0;
}