Skip to content

Pending UniTask after stopping playmode in Unity editor #155

Description

@leonchenyt

What is the current behavior?

Call DialogueRunner.Stop() will potentially leaves pending UniTask

Please provide the steps to reproduce, and if possible a minimal demo of the problem:

  1. Have a script call DialogueRunner.Stop() when the object is destroyed
  2. Stop unity editor

What is the expected behavior?

No pending UniTask show in the UniTask tracker windows

Please tell us about your environment

  • Operating System: windows11
  • Yarn Spinner Version: 3.2.1
  • Extension Version:
  • Unity Version: 6000.4.10

Other information

I think this change simply fix it.

public async YarnTask Stop()
{
    if (Dialogue.IsActive == false) return;

    dialogueCancellationCompletion = new YarnTaskCompletionSource();
    CancelDialogue();
    await dialogueCancellationCompletion.Task;
    dialogueCancellationCompletion = null;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions