mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
修正HttpDispose
修正HttpDispose
This commit is contained in:
@@ -91,6 +91,8 @@ namespace TEngine
|
|||||||
if (isCanceled)
|
if (isCanceled)
|
||||||
{
|
{
|
||||||
Log.Warning($"HttpPost {unityWebRequest.url} be canceled!");
|
Log.Warning($"HttpPost {unityWebRequest.url} be canceled!");
|
||||||
|
unityWebRequest.Dispose();
|
||||||
|
cts.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException ex)
|
catch (OperationCanceledException ex)
|
||||||
@@ -98,11 +100,16 @@ namespace TEngine
|
|||||||
if (ex.CancellationToken == cts.Token)
|
if (ex.CancellationToken == cts.Token)
|
||||||
{
|
{
|
||||||
Log.Warning("HttpPost Timeout");
|
Log.Warning("HttpPost Timeout");
|
||||||
|
unityWebRequest.Dispose();
|
||||||
|
cts.Dispose();
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return unityWebRequest.downloadHandler.text;
|
string ret = unityWebRequest.downloadHandler.text;
|
||||||
|
unityWebRequest.Dispose();
|
||||||
|
cts.Dispose();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user