aboutsummaryrefslogtreecommitdiffstats
path: root/widget_text.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-11 06:39:59 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-11 06:39:59 +0000
commit7d5c275cb8df79637212dc89ab980dabfc39a6df (patch)
treee3f51842280e06133de00726fa987765d4464f10 /widget_text.c
parenta3501369a917c15bdba91811a32c271bbc5dc5b0 (diff)
downloadlcd4linux-7d5c275cb8df79637212dc89ab980dabfc39a6df.tar.gz
[lcd4linux @ 2004-03-11 06:39:58 by reinelt]
big patch from Martin: - reuse filehandles - memory leaks fixed - earlier busy-flag checking with HD44780 - reuse memory for strings in RESULT and hash - netdev_fast to wavid time-consuming regex git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@393 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'widget_text.c')
-rw-r--r--widget_text.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/widget_text.c b/widget_text.c
index 3c8d2dc..5840a34 100644
--- a/widget_text.c
+++ b/widget_text.c
@@ -1,4 +1,4 @@
-/* $Id: widget_text.c,v 1.16 2004/03/08 16:26:26 reinelt Exp $
+/* $Id: widget_text.c,v 1.17 2004/03/11 06:39:59 reinelt Exp $
*
* simple text widget handling
*
@@ -21,6 +21,14 @@
*
*
* $Log: widget_text.c,v $
+ * Revision 1.17 2004/03/11 06:39:59 reinelt
+ * big patch from Martin:
+ * - reuse filehandles
+ * - memory leaks fixed
+ * - earlier busy-flag checking with HD44780
+ * - reuse memory for strings in RESULT and hash
+ * - netdev_fast to wavid time-consuming regex
+ *
* Revision 1.16 2004/03/08 16:26:26 reinelt
* re-introduced \nnn (octal) characters in strings
* text widgets can have a 'update' speed of 0 which means 'never'
@@ -217,7 +225,7 @@ void widget_text_update (void *Self)
{
WIDGET *W = (WIDGET*)Self;
WIDGET_TEXT *T = W->data;
- RESULT result = {0, 0.0, NULL};
+ RESULT result = {0, 0, 0, NULL};
char *preval, *postval, *value;
int update;
@@ -411,13 +419,17 @@ int widget_text_quit (WIDGET *Self) {
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);
+ DelTree(Text->pretree);
+ DelTree(Text->posttree);
+ DelTree(Text->tree);
+ 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;