From fc6a66f7f4f48ce1a6a7f1281d90efd96d6af834 Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Wed, 22 Nov 2017 14:00:34 +0200 Subject: [PATCH] Revert of SCL context using try-finally refs #7634 Change-Id: Icf20bfb365c8965fd1d8af960a0c82e14c45043f --- .../src/org/simantics/document/swt/core/scl/SCL.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/scl/SCL.java b/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/scl/SCL.java index e62d54491..ad5cf7091 100644 --- a/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/scl/SCL.java +++ b/bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/scl/SCL.java @@ -42,9 +42,12 @@ public class SCL { SCLContext sclContext = SCLContext.getCurrent(); Object oldPrinter = sclContext.put(SCLReportingHandler.REPORTING_HANDLER, printer); Object oldGraph = sclContext.put("graph", graph); - fn.apply(Tuple0.INSTANCE); - sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); - sclContext.put("graph", oldGraph); + try { + fn.apply(Tuple0.INSTANCE); + } finally { + sclContext.put(SCLReportingHandler.REPORTING_HANDLER, oldPrinter); + sclContext.put("graph", oldGraph); + } } }); -- 2.47.1