Skip to content

Commit

Permalink
allow gc disposed resources before disposing all resources of stack
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 24, 2022
1 parent b136b1f commit c8322b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ defineBuiltIns(AsyncDisposableStackPrototype, {
var loop = function () {
if (i) {
var disposeMethod = stack[--i];
stack[i] = null;
try {
Promise.resolve(disposeMethod()).then(loop, handleError);
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ defineBuiltIns(DisposableStackPrototype, {
var suppressed;
while (i) {
var disposeMethod = stack[--i];
stack[i] = null;
try {
disposeMethod();
} catch (errorResult) {
Expand Down

0 comments on commit c8322b0

Please sign in to comment.