Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DisposeCapability leak #194

Merged
merged 7 commits into from Apr 10, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion spec.emu
Expand Up @@ -927,7 +927,7 @@ contributors: Ron Buckton, Ecma International
[[DisposableResourceStack]]
</td>
<td>
A List of DisposableResource Records.
A List of DisposableResource Records, or ~empty~.
</td>
<td>
The resources to be disposed. Resources are added in the order they are initialized, and are disposed in reverse order.
Expand Down Expand Up @@ -1018,6 +1018,7 @@ contributors: Ron Buckton, Ecma International
<dl class="header">
</dl>
<emu-alg>
1. Assert: _disposeCapability_.[[DisposableResourceStack]] is not ~empty~.
1. If _method_ is not present then,
1. If _V_ is either *null* or *undefined* and _hint_ is ~sync-dispose~, then
1. Return ~unused~.
Expand Down Expand Up @@ -1107,6 +1108,7 @@ contributors: Ron Buckton, Ecma International
</h1>
<dl class="header"></dl>
<emu-alg>
1. Assert: _disposeCapability_.[[DisposableResourceStack]] is not ~empty~.
1. For each _resource_ of _disposeCapability_.[[DisposableResourceStack]], in reverse list order, do
1. Let _result_ be Dispose(_resource_.[[ResourceValue]], _resource_.[[Hint]], _resource_.[[DisposeMethod]]).
1. If _result_.[[Type]] is ~throw~, then
Expand All @@ -1119,6 +1121,8 @@ contributors: Ron Buckton, Ecma International
1. Set _completion_ to ThrowCompletion(_error_).
1. Else,
1. Set _completion_ to _result_.
1. NOTE: After _disposeCapability_ has been disposed, it will never be used again. The contents of _disposeCapability_.[[DisposableResourceStack]] can be discarded at this point.
rbuckton marked this conversation as resolved.
Show resolved Hide resolved
1. Set _disposeCapability_.[[DisposableResourceStack]] to ~empty~.
1. Return _completion_.
</emu-alg>
</emu-clause>
Expand Down