static A closeOnComponentHide(AutoCloseable closeable, A c) { if (closeable != null) { Var var = new(closeable); bindToComponent(c, null, -> close(getAndClear(var))); } ret c; }