Skip to content

Memory leaks after call socket.send_match_state_async() #225

@zdima40

Description

@zdima40

nakama-godot: v3.4.0
nakama: v3.29.0

Problem:
When sending data via socket.send_match_state_async(), a memory leak occurs. You can see this if you open the Debugger - Monitors section and look at the Objects value, which will increase proportionally to the number of socket.send_match_state_async() calls.

Cause:
The nakama-godot addon internally calls _send_async(), which creates an object _requests[id] = AsyncRequest.new(id, p_parse_type, p_ns, p_result_key), which should be deleted when calling _resume_request(), but this call does not occur, because the client receives a response from the server and calls _received when reading var cid = dict.get("cid") and gets cid = null.
That's why request objects accumulate and are not deleted.
It is worth answering that when sending a message to the server inside the _send_async call, it is clear that different numbers are substituted as the cid value for each call (i.e. everything is fine when sending data).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions