summaryrefslogtreecommitdiff
path: root/nuttx/sched/timer_delete.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-05-31 18:33:44 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-05-31 18:33:44 +0000
commitcce6409e1441451fd6ceef4f2a9d69dd04b5357d (patch)
treec39f3e932bf1844e367988117cddc22dac6f4a5b /nuttx/sched/timer_delete.c
parent7d9196d329877a5daad99c73aec57dc606076a56 (diff)
downloadpx4-nuttx-cce6409e1441451fd6ceef4f2a9d69dd04b5357d.tar.gz
px4-nuttx-cce6409e1441451fd6ceef4f2a9d69dd04b5357d.tar.bz2
px4-nuttx-cce6409e1441451fd6ceef4f2a9d69dd04b5357d.zip
Fix memory leak: Contained watchdog not being deleted with POSIX timer deleted
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@756 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/timer_delete.c')
-rw-r--r--nuttx/sched/timer_delete.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/nuttx/sched/timer_delete.c b/nuttx/sched/timer_delete.c
index 066e158a6..386807575 100644
--- a/nuttx/sched/timer_delete.c
+++ b/nuttx/sched/timer_delete.c
@@ -72,7 +72,7 @@
*
********************************************************************************/
-static void timer_free(struct posix_timer_s *timer)
+static inline void timer_free(struct posix_timer_s *timer)
{
irqstate_t flags;
@@ -137,10 +137,12 @@ int timer_delete(timer_t timerid)
*get_errno_ptr() = EINVAL;
return ERROR;
}
-
- /* Disarm the timer */
-
- (void)wd_cancel(timer->pt_wdog);
+
+ /* Free the underlying watchdog instance (the timer will be canceled by the
+ * watchdog logic before it is actually deleted)
+ */
+
+ (void)wd_delete(timer->pt_wdog);
/* Release the timer structure */