diff options
-rw-r--r-- | lib/supple/comms.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/supple/comms.lua b/lib/supple/comms.lua index ae2779c..2b22ded 100644 --- a/lib/supple/comms.lua +++ b/lib/supple/comms.lua @@ -155,11 +155,15 @@ local function wait_for_response() else resp = request.response(unpack(res)) end + -- Force anything no longer anchored to be GC'd before we reply + gc "collect" send_msg(resp) end if back.method == "__gc" then -- __gc is the garbage collect mechanism objects.forget_mine(back.object) + -- Force anything no longer anchored to be GC'd before we reply + gc "collect" send_msg(request.response()) elseif back.method == "__call" then -- __call is the function call mechanism @@ -222,4 +226,4 @@ return { _wait = wait_for_response, _set_fd = set_fd, set_limits = set_limits, -}
\ No newline at end of file +} |