Remove stored contexts in tests to avoid leaks

This commit is contained in:
Nikolay Krasko
2017-03-23 18:37:25 +03:00
parent 2aa1b19ec9
commit 2c4f702d50
@@ -64,8 +64,11 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
private var oldDisableKotlinInternalClasses = false private var oldDisableKotlinInternalClasses = false
private var oldRenderDelegatedProperties = false private var oldRenderDelegatedProperties = false
protected lateinit var evaluationContext: EvaluationContextImpl protected var _evaluationContext: EvaluationContextImpl? = null
protected lateinit var debuggerContext: DebuggerContextImpl protected val evaluationContext get() = _evaluationContext!!
protected var _debuggerContext: DebuggerContextImpl? = null
protected val debuggerContext get() = _debuggerContext!!
override fun initApplication() { override fun initApplication() {
super.initApplication() super.initApplication()
@@ -74,7 +77,11 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
override fun tearDown() { override fun tearDown() {
super.tearDown() super.tearDown()
restoreDefaultSettings() restoreDefaultSettings()
_evaluationContext = null
_debuggerContext = null
} }
protected fun configureSettings(fileText: String) { protected fun configureSettings(fileText: String) {
@@ -136,8 +143,8 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
} }
protected fun initContexts(suspendContext: SuspendContextImpl) { protected fun initContexts(suspendContext: SuspendContextImpl) {
evaluationContext = createEvaluationContext(suspendContext) _evaluationContext = createEvaluationContext(suspendContext)
debuggerContext = createDebuggerContext(suspendContext) _debuggerContext = createDebuggerContext(suspendContext)
} }
protected fun SuspendContextImpl.doStepInto(ignoreFilters: Boolean, smartStepFilter: MethodFilter?) { protected fun SuspendContextImpl.doStepInto(ignoreFilters: Boolean, smartStepFilter: MethodFilter?) {