Avoid runnig potentially unsafe code in finally{}, which can mask the original exception.
This commit is contained in:
parent
2ae25c6756
commit
34dc1208f3
|
|
@ -58,16 +58,17 @@ class MemEvaluationSession : EvaluationSession, SessionObjects {
|
|||
ourBackend.ourSession.set(session)
|
||||
|
||||
val durations = myParameters.get("profiling.data") as MutableMap<String, String>?
|
||||
val profiler = durations?.let{ Profiler() }
|
||||
val profiler = durations?.let { Profiler() }
|
||||
try {
|
||||
session.launch(myParameters["main"] as Constraint, profiler)
|
||||
}
|
||||
finally {
|
||||
ourBackend.ourSession.set(null)
|
||||
profiler?.run {
|
||||
formattedData().entries.forEach { e -> durations?.put(e.key, e.value) }
|
||||
clear()
|
||||
}
|
||||
}
|
||||
|
||||
profiler?.run {
|
||||
formattedData().entries.forEach { e -> durations?.put(e.key, e.value) }
|
||||
clear()
|
||||
}
|
||||
|
||||
return session
|
||||
|
|
|
|||
Loading…
Reference in New Issue