summaryrefslogtreecommitdiff
path: root/nuttx/sched/group
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-22 14:49:05 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-22 14:49:05 -0600
commit6fa05135bf85fb38a13cd1d0460399433b780e34 (patch)
treec2742c9b8279535aedf7a0961d418f5c82334366 /nuttx/sched/group
parent2c743749420b1fd6ad9cee20de829e7b580b6bb7 (diff)
downloadnuttx-6fa05135bf85fb38a13cd1d0460399433b780e34.tar.gz
nuttx-6fa05135bf85fb38a13cd1d0460399433b780e34.tar.bz2
nuttx-6fa05135bf85fb38a13cd1d0460399433b780e34.zip
Need to release the addess environment when the task group is released
Diffstat (limited to 'nuttx/sched/group')
-rw-r--r--nuttx/sched/group/group_leave.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/nuttx/sched/group/group_leave.c b/nuttx/sched/group/group_leave.c
index ec25792e7..c6f15ddf0 100644
--- a/nuttx/sched/group/group_leave.c
+++ b/nuttx/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 <gnutt@nuttx.org>
*
* 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 */