Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

webRequest timeout gives the following error " Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details." Eventhough I think I have safely disposed the webRequest

$
0
0
WWWForm form = new WWWForm(); form.AddField("username", loginData.username); // use userName form.AddField("password", loginData.password);// use pswd here using (UnityWebRequest www = UnityWebRequest.Post("https://mhrms.io/test/api/user_login", form)) { www.timeout = 20;// **** THIS GIVES ERROR *** // I want to use this to stop web reuest in case of network or server // failure yield return www.SendWebRequest(); if (www.result != UnityWebRequest.Result.Success) { Debug.Log("ERROR " + www.error); www.Dispose(); StopAllCoroutines(); } else { loginRes = JsonUtility.FromJson(www.downloadHandler.text); Debug.Log(loginRes); if (loginRes.response_code == "200") { SaveLoginData(loginData); AppControllService.Instance.On_SignIn(loginRes); // PunchLogService.Instance.StartShift(); } else { AppControllService.Instance.TogglePanel(PanelName.LoginPanel); resultTxt.gameObject.SetActive(true); resultTxt.text = loginRes.message; Debug.Log("Login FAIL msg " + loginRes.message); } Debug.Log("Form upload complete!" + www.downloadHandler.text); } www.Dispose(); StopAllCoroutines(); } }

Viewing all articles
Browse latest Browse all 387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>