Skip to content

Commit e7a01c7

Browse files
committed
Fix #39
1 parent a425606 commit e7a01c7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
### Fixed
55
- Make `Promise.is` work with promises from old versions of the library (#41)
66
- Make `Promise.delay` properly break out of the current loop (#40)
7+
- Allow upvalues captured by queued callbacks to be garbage collected when the Promise resolves by deleting the queues when the Promise settles (#39)
78

89
## [3.0.0] - 2020-08-17
910
### Changed

lib/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,10 @@ function Promise.prototype:_finalize()
12921292
coroutine.wrap(callback)(self._status)
12931293
end
12941294

1295+
self._queuedFinally = nil
1296+
self._queuedReject = nil
1297+
self._queuedResolve = nil
1298+
12951299
-- Clear references to other Promises to allow gc
12961300
if not Promise.TEST then
12971301
self._parent = nil

0 commit comments

Comments
 (0)