The circular self-reference of prev_timer field can cause problems in some circumstances.
For example, exporting TimerOutput using JLD causes StackOverflowError.
Workaround for #40
I realise this is an issue for JLD rather than TimerOutputs, so marking as RFC. However, it seems to provide a workaround with little impact on TimerOutputs.
Change type of prev_timer to Union{TimerOutput,Nothing} which allows setting it to nothing, breaking the circularity.
It also seems consistent that prev_timer == nothing whenever prev_timer_label == "".
The circular self-reference of
prev_timer
field can cause problems in some circumstances. For example, exportingTimerOutput
usingJLD
causesStackOverflowError
. Workaround for #40I realise this is an issue for
JLD
rather thanTimerOutputs
, so marking as RFC. However, it seems to provide a workaround with little impact onTimerOutputs
.Change type of
prev_timer
toUnion{TimerOutput,Nothing}
which allows setting it tonothing
, breaking the circularity. It also seems consistent thatprev_timer == nothing
wheneverprev_timer_label == ""
.Before saving to
JLD
, setprev_timer
tonothing
.