- Home /
StopAllCoroutines does NOT cancel a yield WWW download?
After testing,
I am almost certain that if you StopAllCoroutines,
it does not stop the actual download of say a large image, from a yield on WWW.
In fact, how do you stop a large download you have started using a yield on WWW?
Thanks....
We've never found a way. We just have a wrapper class that abandons the download and disposes of it if/when it finishes.
Hey Julien, thanks for that report. Did you see this answer,
http://answers.unity3d.com/questions/465060/how-to-stop-a-www-which-is-in-progress.html
maybe the guy has the solution.
Answer by darthbator · May 28, 2013 at 09:29 PM
I'm not sure if this is the issue but I've noticed that stopCoroutine doesn't work AT ALL if you launch the routine by directly calling the method and not by passing it the name of the method as a string. Could you be running into that issue?
Fascinating! BTW when you typed stopCoroutine did you mean StopAllCoroutines ?
I was not even aware there is a stopCoroutine ! :O
Answer by Eric5h5 · May 28, 2013 at 10:42 PM
Instead of
yield www;
do
while (!www.isDone && someCondition) {
yield;
// set someCondition to false in order to abandon the download
}
Eric, I'm pretty sure that does not stop the download of data on the http connection.
(If I'm not mistaken, the code you present does not, in any way, affect the coroutine itself, right? In that idiom the meaning of someCondition is "when someCondition becomes true, I'll stop bothering here waiting for the coroutine and go on with what I was doing. The coroutine will take care of itself and finish and I won't wait for it no more." )
I'll triple-check though. This guys believes he has the answer, which is a breakthrough if true
http://answers.unity3d.com/questions/465060/how-to-stop-a-www-which-is-in-progress.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613103018im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
embed google maps into unity 3d 4 Answers
Is WWW.movie supposed to be this slow? 2 Answers
json (LitJSON) from PHP array.. How? 0 Answers
WWW didnt work on device ON UNITY 3.3? 2 Answers
GM or Admin System 1 Answer