aboutsummaryrefslogtreecommitdiffstats
path: root/util/promise.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
committerKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
commit929103b8672e1395eedd663fb172a91ce197ec33 (patch)
tree94b4ebcb9443e8e6751e1903ade3c9dc8ec9d678 /util/promise.lua
parentb22125f0645b3281d99843dcdb7b44e92b9167cd (diff)
parentcf87960bda697b3727b5b62ab8c983a48b8c5314 (diff)
downloadprosody-929103b8672e1395eedd663fb172a91ce197ec33.tar.gz
prosody-929103b8672e1395eedd663fb172a91ce197ec33.zip
Merge 0.11->trunk
Diffstat (limited to 'util/promise.lua')
-rw-r--r--util/promise.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/promise.lua b/util/promise.lua
index 07c9c4dc..0b182b54 100644
--- a/util/promise.lua
+++ b/util/promise.lua
@@ -49,6 +49,9 @@ local function promise_settle(promise, new_state, new_next, cbs, value)
for _, cb in ipairs(cbs) do
cb(value);
end
+ -- No need to keep references to callbacks
+ promise._pending_on_fulfilled = nil;
+ promise._pending_on_rejected = nil;
return true;
end