From 4e699b00de8175b95c8d9f9c07147dbd6b6d6653 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 Aug 2014 14:49:05 -0600 Subject: [PATCH] Need to release the addess environment when the task group is released --- sched/group/group_leave.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sched/group/group_leave.c b/sched/group/group_leave.c index ec25792e745..c6f15ddf0e1 100644 --- a/sched/group/group_leave.c +++ b/sched/group/group_leave.c @@ -1,7 +1,7 @@ /***************************************************************************** * sched/group/group_leave.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -169,11 +169,11 @@ static inline void group_release(FAR struct task_group_s *group) pthread_release(group); #endif +#if CONFIG_NFILE_DESCRIPTORS > 0 /* Free all file-related resources now. We really need to close files as * soon as possible while we still have a functioning task. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Free resources held by the file descriptor list */ files_releaselist(&group->tg_filelist); @@ -196,18 +196,24 @@ static inline void group_release(FAR struct task_group_s *group) net_releaselist(&group->tg_socketlist); #endif /* CONFIG_NSOCKET_DESCRIPTORS */ +#ifndef CONFIG_DISABLE_ENVIRON /* Release all shared environment variables */ -#ifndef CONFIG_DISABLE_ENVIRON env_release(group); #endif +#ifndef CONFIG_DISABLE_MQUEUE /* Close message queues opened by members of the group */ -#ifndef CONFIG_DISABLE_MQUEUE mq_release(group); #endif +#ifdef CONFIG_ADDRENV + /* Destroy the group address environment */ + + (void)up_addrenv_destroy(group->addrenv); +#endif + #ifdef HAVE_GROUP_MEMBERS /* Remove the group from the list of groups */