After update to Unity 5.3 We’ve got a deadlock on iOS.
WWW class works fine for simple http requests. But there is a deadlock during loading a texture with WWW class. Probably it’s happens because I manually call Dispose().
Here is a call stack:

Confirmed. This is definitely happens because of calling Dispose in WWW.
Hi, could you submit a bug report and attache a simple reproduction project to it? Please post the bug number here. Thanks!
Hi. This is my first bug report that I’ve created yesterday: 753977_lioosj0cg583a8uk
This is bug report that I’ve just created with steps to reproduce and test project: 754382_6haafsmbq3l2kdfk
Thanks, we are looking into this.
Could you perhaps remove full links to the bugs and leave only the numbers? Full links allow anyone to view full bug history and attachments.
Hello Andrey,
We recently made some changes to the WWW class that should fix this deadlock that will be release in the first patch release of 5.3. I tested out your project today and I was unable to get a deadlock with these changes. Thanks for submitting your project. Please let us know if you experience this again in the patch release. Thanks.
Thanks Christopher. I’ll install patch release and check it.
@christophergoy I installed version 5.3.1. Bug is fixed. Thank you.
i find a new bug is 5.3.1, the ios http can’t work , i revert the WWWconnection.mm.it work.
is it safe to revert ??
I’m getting exactly the opposite behavior: WWW class worked fine on 5.3.0 and it never returns from yield when loading a texture on 5.3.1f1 or 5.3.1p1
Edit: Just wanted to thank XiaoJi! I wasn’t able to downgrade to 5.3.0 anymore so reverting the wwwconnection.mm file worked as a charm ![]()
@XiaoJi @Elkis Did you report a bug?
When I reported a bug with example project Unity team fixed it in 24 hours.
Since the project that presented the bug is very big, I tried to replicate the behavior on a new project. I don’t know why but I am unable to reproduce it, WWW class is working fine on new projects.
I guess it might be some other plugin causing this or the fact that I’ve been upgrading this project since 5.2 that is causing this issue.
Anyway, since new projects work fine and I got a workaround for this particular project, I guess all is good ![]()
I wrote new test application for WWW.Dispose() and report a bug.
Deadlock steel exists.
I’ve tested this script for iOS, android, editor.
There is a deadlock for iOS.
Script works with lags (0.5 - 1 seconds) for android.
And script crashes in editor.
Here are test script:
using UnityEngine;
using System.Collections;
public class TestWWW : MonoBehaviour
{
private WWW mWWW;
private int mDisposeCounter;
private int mDisposeThreshold;
private bool mSuccess;
private GUILayoutOption mMinWidth;
private GUILayoutOption mMinHeight;
void Awake()
{
mMinWidth = GUILayout.MinWidth(400);
mMinHeight = GUILayout.MinHeight(150);
}
// Update is called once per frame
void Update()
{
if (mWWW != null)
{
if (mWWW.isDone)
{
mWWW.Dispose();
mWWW = null;
mSuccess = true;
}
else
{
++mDisposeCounter;
if (mDisposeCounter > mDisposeThreshold)
{
++mDisposeThreshold;
Debug.Log("Dispose: " + mDisposeCounter);
mWWW.Dispose();
CreateWWW();
}
}
}
}
void OnGUI()
{
if (mWWW != null)
{
GUILayout.Label(string.Format("In progress: {0}, {1}", mDisposeCounter, mDisposeThreshold), mMinWidth, mMinHeight);
}
else
{
GUILayout.Label("Success: " + mSuccess, mMinWidth, mMinHeight);
if (GUILayout.Button("Create Request", mMinWidth, mMinHeight))
{
mDisposeThreshold = 0;
CreateWWW();
mWWW.Dispose();
CreateWWW();
}
}
}
private void CreateWWW()
{
mWWW = new WWW("http://google.com");
mDisposeCounter = 0;
}
}
Hi Andrey,
I will test your script out. Could you tell me the bug number for this?
Thanks,
Chris
Hi Andrey,
I have confirmed that the deadlock still exists with your script posted… I am currently fixing it. I will update your bug accordingly once you give me the case number.
Thanks,
Chris
Hi, Chis! Thanks for quick reply. The bug number is 759480.
Great! Thanks.
Hi Andrey,
I have a fix going through our review process. Once I know which release it will get into, I will notify you here. Thanks again for your repro script, it was helpful in uncovering this.
Cheers,
Chris
This did not get into 5.3.1p3, did it?
Hi @wgt_jimmy ,
No unfortunately it did not. I am trying to target the next patch release. I will confirm when I know.
Thanks,
Chris