Free the clock's servo and moving average on destroy.

The destroy method is supposed to undo everything that the create does.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-08-20 09:05:42 +02:00
parent 08bee20be2
commit e4c3fb2432
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,8 @@ static void clock_destroy(struct clock *c)
if (c->clkid != CLOCK_REALTIME) { if (c->clkid != CLOCK_REALTIME) {
phc_close(c->clkid); phc_close(c->clkid);
} }
servo_destroy(c->servo);
mave_destroy(c->avg_delay);
memset(c, 0, sizeof(*c)); memset(c, 0, sizeof(*c));
} }