Fix status bar gc

This commit is contained in:
crschnick 2024-03-04 15:22:57 +00:00
parent 0646aedaf9
commit 4df4a7572f

View file

@ -7,6 +7,7 @@ import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.fxcomps.SimpleCompStructure;
import io.xpipe.app.fxcomps.augment.ContextMenuAugment;
import io.xpipe.app.fxcomps.impl.LabelComp;
import io.xpipe.app.fxcomps.util.BindingsHelper;
import io.xpipe.app.fxcomps.util.PlatformThread;
import io.xpipe.app.util.HumanReadableFormat;
import javafx.beans.binding.Bindings;
@ -55,7 +56,7 @@ public class BrowserStatusBarComp extends SimpleComp {
model.getProgress().getValue().getTotal(), true);
},
model.getProgress()));
var progressComp = new LabelComp(Bindings.createStringBinding(
var progressComp = new LabelComp(BindingsHelper.persist(Bindings.createStringBinding(
() -> {
if (model.getProgress().getValue() == null
|| model.getProgress().getValue().done()) {
@ -69,7 +70,7 @@ public class BrowserStatusBarComp extends SimpleComp {
},
transferredCount,
allCount,
model.getProgress()));
model.getProgress())));
return progressComp;
}