Search Issue Tracker

Fixed in 5.4.2

Votes

15

Found in

5.3.3p2

Issue ID

777663

Regression

No

[Android] Application freezes on WWW.Dispose if connection is canceled

Networking

-

Reproduction steps:
1) Open attached project "TimeoutBug"
2) Build and run on an android device
--- According to the user also reproducible on iOS
3) Press "Start request" button
4) Either press "Cancel" button or "Cancel and Dispose" button or wait 15 seconds
--- You should notice that the application froze

Comments (4)

  1. 6b3eeaf8b66e76d23d741f16ac5dad69?d=mm

    Dmitriy-Yukhanov

    Aug 15, 2016 16:46

    Looking forward to the fix, really makes some pain.

  2. F5f1fb1742ea18bcc2b80bf4e828bc55?d=mm

    hakansaglam

    May 26, 2016 11:40

    As a workaround, you can dispose www in another thread.

    private void DisposeWWWInBackground (WWW www)
    {
    new Thread( () => {
    Debug.Log("WWW dispose started in background thread.");
    www.Dispose();
    Debug.Log("WWW dispose finished.");
    }).Start();
    }

  3. 737346fba8351413d63c75f8c9a727b9?d=mm

    Seans

    Apr 08, 2016 09:40

    Any workaround for this now?

  4. 93d455f67e43ad71801afde84b63c69c?d=mm

    jhina

    Mar 18, 2016 03:21

    We are also seeing this same bug. We start a co-routine with this code:

    WWW www = new WWW(url, System.Text.Encoding.UTF8.GetBytes(postJSONText), postHeader);
    bool hasTimeLeft = true;
    while (!www.isDone && hasTimeLeft)
    {
    yield return null;
    hasTimeLeft = Time.realtimeSinceStartup <= startTime + _waitForDownloadSeconds;
    }
    if (hasTimeLeft) //We didn't time out!
    {
    //Do some stuff.
    }
    www.Dispose();

    If the internet is slow and _waitForDownloadSeconds occurs before WWW.isDone the game freezes.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.