mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dmsetup: only free resources once in the final interval
The _update_interval_times() function is called once per reported object: when shutting down at the end of a run only the first call should free timestamps. Clear the timestamp pointers after free and use this to signal to other callers that the clock is already shut down.
This commit is contained in:
parent
0f45aa7f31
commit
e96041e18f
@ -637,6 +637,12 @@ static int _update_interval_times(void)
|
||||
uint64_t delta_t;
|
||||
int r = 0;
|
||||
|
||||
/*
|
||||
* Clock shutdown for exit - nothing to do.
|
||||
*/
|
||||
if (_timer_fd == TIMER_STOPPED && !_cycle_timestamp)
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* Current timestamp. If _new_interval is set this is used as
|
||||
* the new cycle start timestamp.
|
||||
@ -717,6 +723,9 @@ out:
|
||||
if (_cycle_timestamp)
|
||||
dm_timestamp_destroy(_cycle_timestamp);
|
||||
dm_timestamp_destroy(this_timestamp);
|
||||
|
||||
/* Clear timestamp pointers to signal shutdown. */
|
||||
_cycle_timestamp = this_timestamp = NULL;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user