-
-
Notifications
You must be signed in to change notification settings - Fork 41
Description
The invocation of filter!() in start!() is mutating.
Line 146 in 7cc1a29
| filter!(c -> c != ProgressColumn, job.columns) |
If I call addjob!() or swapjob!() with a vector of column elements, this pruning will mutate the vector at the callsite. This is spooky action at a distance and can lead to unexpected behaviour.
It is best if the vector is copied at the point of ProgressJob creation: specifically, this line:
Line 118 in 7cc1a29
| columns, |
should become
copy(columns),and the same should be done for other mutable items passed across the interface.
In my use, a config array used for two, cases where N = nothing and N isa Integer, was being erroneously mutated -- the progress bars in the image linked in #279 were being spuriously deleted.
The last commit in PR #279 fixes this issue, but it may be desirable to patch this while you review the PR.