I am making patch system using WWW on Unity 4.6.2 Android
When I play my app on device and test by the momory profiler, there are some strange memory leak.
After patch is finishd, Used Mono Memory still remain on profiler.
So, I test on Unity 4.5.2, there are no memory leak.
I attach two images. one is tested by Unity 4.5.2, and another one is tested by Unity 4.6.2
And It is my source how to using WWW Class.
public IEnumerator DownloadFileRoutine(string url, string fileName, Action OnCompletedFile, Action _OnProgressFile)
{
isErrorDone = false;
using (www = new WWW(url))
{
OnProgressFile = _OnProgressFile;
//__DebugOutput("DownloadFileRoutine : " + www.progress);
yield return www;
UnityEngine.Debug.Log(“Final DownloadFileRoutine”);
if (!string.IsNullOrEmpty(www.error))
{
UnityEngine.Debug.LogError(www.error);
OnCompletedFile.Invoke(ERRORLEVEL.ERR_NEEDRETRY);
isErrorDone = true;
yield break;
}
else
{
bool bSave = SaveFile(fileName, www.bytes);
yield return true;
if (bSave)
{
if (OnCompletedFile != null)
{
OnCompletedFile.Invoke(ERRORLEVEL.SUCCESS);
}
}
else
{
OnCompletedFile.Invoke(ERRORLEVEL.ERR_ETCERROR);
}
}
}
yield return true;
}