local: don't remove handlers in finalization
Require all handlers to be deregistered by their users before the local finalization.
This commit is contained in:
parent
bf92314dc4
commit
5f6f265f80
7 changed files with 20 additions and 7 deletions
12
local.c
12
local.c
|
@ -185,13 +185,11 @@ LCL_Initialise(void)
|
|||
void
|
||||
LCL_Finalise(void)
|
||||
{
|
||||
while (change_list.next != &change_list)
|
||||
LCL_RemoveParameterChangeHandler(change_list.next->handler,
|
||||
change_list.next->anything);
|
||||
|
||||
while (dispersion_notify_list.next != &dispersion_notify_list)
|
||||
LCL_RemoveDispersionNotifyHandler(dispersion_notify_list.next->handler,
|
||||
dispersion_notify_list.next->anything);
|
||||
/* Make sure all handlers have been removed */
|
||||
if (change_list.next != &change_list)
|
||||
assert(0);
|
||||
if (dispersion_notify_list.next != &dispersion_notify_list)
|
||||
assert(0);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
|
1
manual.c
1
manual.c
|
@ -92,6 +92,7 @@ MNL_Initialise(void)
|
|||
void
|
||||
MNL_Finalise(void)
|
||||
{
|
||||
LCL_RemoveParameterChangeHandler(slew_samples, NULL);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
|
|
@ -185,6 +185,8 @@ NSR_Finalise(void)
|
|||
clean_source_record(record);
|
||||
}
|
||||
|
||||
LCL_RemoveParameterChangeHandler(slew_sources, NULL);
|
||||
|
||||
ARR_DestroyInstance(records);
|
||||
ARR_DestroyInstance(pools);
|
||||
|
||||
|
|
|
@ -304,6 +304,8 @@ REF_Finalise(void)
|
|||
update_drift_file(LCL_ReadAbsoluteFrequency(), our_skew);
|
||||
}
|
||||
|
||||
LCL_RemoveParameterChangeHandler(handle_slew, NULL);
|
||||
|
||||
Free(fb_drifts);
|
||||
|
||||
initialised = 0;
|
||||
|
|
|
@ -573,6 +573,10 @@ RTC_Linux_Finalise(void)
|
|||
(void) RTC_Linux_WriteParameters();
|
||||
|
||||
}
|
||||
|
||||
if (rtc_sec)
|
||||
LCL_RemoveParameterChangeHandler(slew_samples, NULL);
|
||||
|
||||
Free(rtc_sec);
|
||||
Free(rtc_trim);
|
||||
Free(system_times);
|
||||
|
|
4
smooth.c
4
smooth.c
|
@ -272,6 +272,10 @@ void SMT_Initialise(void)
|
|||
|
||||
void SMT_Finalise(void)
|
||||
{
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
LCL_RemoveParameterChangeHandler(handle_slew, NULL);
|
||||
}
|
||||
|
||||
int SMT_IsEnabled(void)
|
||||
|
|
|
@ -417,6 +417,8 @@ SYS_Generic_Finalise(void)
|
|||
|
||||
LCL_ReadRawTime(&now);
|
||||
stop_fastslew(&now);
|
||||
|
||||
LCL_RemoveParameterChangeHandler(handle_step, NULL);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
|
Loading…
Reference in a new issue