Skip to content

Commit 042c1b7

Browse files
committed
oh wait, im dumb, sorry
1 parent 8bcbce5 commit 042c1b7

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • src/main/kotlin/com/lambda/task

src/main/kotlin/com/lambda/task/Task.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import kotlin.time.toDuration
3636
@Suppress("unused")
3737
abstract class Task<Result> : Nameable, Muteable {
3838
var parent: Task<*>? = null
39-
var parentPausing = false
4039
val subTasks = mutableListOf<Task<*>>()
4140
var state = State.Init
4241
override val isMuted: Boolean get() = state == State.Paused || state == State.Init
@@ -119,7 +118,6 @@ abstract class Task<Result> : Nameable, Muteable {
119118
parent = owner
120119
if (verboseDebug) LOG.info("${owner.name} started $name")
121120
if (pauseParent) {
122-
parentPausing = true
123121
if (verboseDebug) LOG.info("$name pausing parent ${owner.name}")
124122
if (owner !is RootTask) owner.pause()
125123
}
@@ -204,7 +202,7 @@ abstract class Task<Result> : Nameable, Muteable {
204202
unsubscribe()
205203
runSafe { onCancel() }
206204
cancelSubTasks()
207-
parent?.subTasks?.remove(this)
205+
if (removeFromParent) parent?.subTasks?.remove(this)
208206
parent?.activate()
209207
if (this is RootTask) return
210208
if (state == State.Completed || state == State.Cancelled) return

0 commit comments

Comments
 (0)