Skip to content

Commit

Permalink
Fix #39
Browse files Browse the repository at this point in the history
  • Loading branch information
evaera committed Aug 24, 2020
1 parent a425606 commit e7a01c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Fixed
- Make `Promise.is` work with promises from old versions of the library (#41)
- Make `Promise.delay` properly break out of the current loop (#40)
- Allow upvalues captured by queued callbacks to be garbage collected when the Promise resolves by deleting the queues when the Promise settles (#39)

## [3.0.0] - 2020-08-17
### Changed
Expand Down
4 changes: 4 additions & 0 deletions lib/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,10 @@ function Promise.prototype:_finalize()
coroutine.wrap(callback)(self._status)
end

self._queuedFinally = nil
self._queuedReject = nil
self._queuedResolve = nil

-- Clear references to other Promises to allow gc
if not Promise.TEST then
self._parent = nil
Expand Down

0 comments on commit e7a01c7

Please sign in to comment.