Skip to content

Commit

Permalink
dispose with unity web request after request ends
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Gehorsam committed Aug 24, 2021
1 parent 976a605 commit 657a6a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Packages/Nakama/Runtime/UnityWebRequestAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public Task<string> SendAsync(string method, Uri uri, IDictionary<string, string
var tcs = new TaskCompletionSource<string>();
cancellationToken?.Register(() => tcs.SetCanceled());
StartCoroutine(SendRequest(www, resp => tcs.SetResult(resp), err => tcs.SetException(err)));
tcs.Task.ContinueWith(res => www.Dispose());
return tcs.Task;
}

Expand Down

0 comments on commit 657a6a3

Please sign in to comment.