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
This commit is contained in:
patacongo
2008-05-31 18:33:44 +00:00
parent 9a18c880a1
commit ae5cc87281
6 changed files with 83 additions and 57 deletions
+7 -5
View File
@@ -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 */