From: bsinou Date: Sat, 21 Jan 2017 17:55:08 +0000 (+0100) Subject: Close forgotten session X-Git-Tag: argeo-commons-2.1.58~2 X-Git-Url: https://git.argeo.org/?a=commitdiff_plain;h=86451eca4681e2d7202d3d958d506e063c24668d;p=lgpl%2Fargeo-commons.git Close forgotten session --- diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/fs/CmsFsBrowser.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/fs/CmsFsBrowser.java index 8562138a9..8aab1ec21 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/fs/CmsFsBrowser.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/fs/CmsFsBrowser.java @@ -28,6 +28,7 @@ import org.argeo.eclipse.ui.fs.FsTableViewer; import org.argeo.eclipse.ui.fs.FsUiConstants; import org.argeo.eclipse.ui.fs.FsUiUtils; import org.argeo.eclipse.ui.fs.NioFileLabelProvider; +import org.argeo.jcr.JcrUtils; import org.argeo.node.NodeUtils; import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; @@ -93,13 +94,16 @@ public class CmsFsBrowser extends Composite { private final static String NODE_PREFIX = "node://"; private String getCurrentHomePath() { + Session session = null; try { Repository repo = currentBaseContext.getSession().getRepository(); - Session session = CurrentUser.tryAs(() -> repo.login()); + session = CurrentUser.tryAs(() -> repo.login()); String homepath = NodeUtils.getUserHome(session).getPath(); return homepath; } catch (Exception e) { throw new CmsException("Cannot retrieve Current User Home Path", e); + } finally { + JcrUtils.logoutQuietly(session); } }