mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
修正HttpDispose
修正HttpDispose
This commit is contained in:
@@ -91,6 +91,8 @@ namespace TEngine
|
||||
if (isCanceled)
|
||||
{
|
||||
Log.Warning($"HttpPost {unityWebRequest.url} be canceled!");
|
||||
unityWebRequest.Dispose();
|
||||
cts.Dispose();
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
@@ -98,11 +100,16 @@ namespace TEngine
|
||||
if (ex.CancellationToken == cts.Token)
|
||||
{
|
||||
Log.Warning("HttpPost Timeout");
|
||||
unityWebRequest.Dispose();
|
||||
cts.Dispose();
|
||||
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