OK, I found a workaround that fixes my problem, but I don’t understand why it works.
Old code:
log = load_log(7, logfile)
New code:
tmp = load_log(7, logfile)
for i in 1:length(tmp.syslog)
dummy=tmp.syslog[i]
end
log = tmp
The variable log is storing a flight log file. You can think of it as an array of structs. The last of these structs was used to display the last 3D view. Now I load a new log file, so the old one needs to be replaced (and garbage collected) by the new one, but it shall not be garbage collected before the new one is completely loaded.
Anyway, I do not understand why accessing each element of the new log file and putting it in a dummy variable solves my problem.
You can see the complete code here: https://github.com/ufechner7/KiteViewer/blob/main/src/KiteViewerPure.jl