diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-04-10 17:28:47 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-04-10 17:28:47 +0000 | 
| commit | 1f98ca9b57ecd36d032449972b7b9f006ad1e06f (patch) | |
| tree | 93902fb3eb844f7cc70107f78423b294ec9ed9cf /common/glib-ectomy.c | |
| parent | 99ab0e609a4590d0027ae42d95ed1ca0b6c2e86f (diff) | |
Fixed discoverable timeout and timeout list data memory leak
Diffstat (limited to 'common/glib-ectomy.c')
| -rw-r--r-- | common/glib-ectomy.c | 9 | 
1 files changed, 9 insertions, 0 deletions
| diff --git a/common/glib-ectomy.c b/common/glib-ectomy.c index f1d79e7f..7644fd18 100644 --- a/common/glib-ectomy.c +++ b/common/glib-ectomy.c @@ -133,6 +133,14 @@ guint g_io_add_watch(GIOChannel *channel, GIOCondition condition,  						func, user_data, NULL);  } +static void timeout_free(void *data, void *user_data) +{ +	struct timeout *t = data; + +	if (t) +		free (t); +} +  static GMainContext *g_main_context_default()  { @@ -310,6 +318,7 @@ void g_main_loop_unref(GMainLoop *loop)  	if (!loop->context)  		return; +	slist_foreach(loop->context->ltimeout, timeout_free, NULL);  	slist_free(loop->context->ltimeout);  	free(loop->context);  } | 
