@@ -349,7 +349,7 @@ fun Disposable.disposingOneShotDelayedTask(name: String, delay: Long, block: ()
349349 consider this:
350350 calling disposingOneShotDelayedTask on a Disposable ,lets say a project service. and we would just register
351351 a child disposable on the project service to cancel the task.
352- if the project is closed before the task is executed the parent disposable, the service, will be disposed with all its children
352+ if the project is closed before the task is executed, the parent disposable, the service, will be disposed with all its children
353353 and the task will be canceled.
354354 but if the task did execute and the project service was not disposed yet, we are left with a disposable child that will be disposed
355355 only when the service is disposed.
@@ -359,14 +359,14 @@ fun Disposable.disposingOneShotDelayedTask(name: String, delay: Long, block: ()
359359 the solution:
360360 calling disposingOneShotDelayedTask on a Disposable project service. the parent.
361361 we create here a new disposable,the child, register it as child of the parent.
362- register the task on the child disposable and in disposingOneShotDelayedTask0 we register a child for the child.
362+ register the task on the child disposable and in disposingOneShotDelayedTaskImpl we register a child for the child.
363363 if the parent is disposed before the task is executed, the first child will be disposed, its child will be disposed and the task
364364 will be canceled.
365365 if the task executed and completed, the task itself disposes the first child, which will dispose its child. and now the parent
366366 doesn't have a leftover child.
367367
368- Notice that we execute disposingOneShotDelayedTask0 on the child disposable, its private and should only be used internally.
369- in disposingOneShotDelayedTask0 when the task completes it disposes this in the finally block.
368+ Notice that we execute disposingOneShotDelayedTaskImpl on the child disposable, its private and should only be used internally.
369+ in disposingOneShotDelayedTaskImpl when the task completes it disposes ' this' in the finally block.
370370 see unit tests:
371371 testDisposingOneShotDelayedTaskParentDisposableHasNoChildren
372372 testDisposingOneShotDelayedTaskCanceledParentDisposableHasNoChildren
0 commit comments