Skip to content

How to free the memory created by map_json_to_struct in child thread #21

Description

@bskrish757

Hi,

Background:

I have a main thread that has to call map_json_to_struct and pass the resulting structure to a child thread (not calling map_json_to_struct inside the child thread to avoid using mutex because it will slow down my execution in case of a huge load), The converted structure is not used by any other thread including the main thread.

Issue:

Now the issue is, that whenever the child thread finishes execution, I get memory leaks for some memory created by map_json_to_struct in the main thread,

Ultimately I want to free the resource in the child thread itself(there will not be any synchronization issue as this mapped structure is not used by any other threads)
NOTE: My main thread cannot wait for the child thread to finish so i cannot use join call.

is there a way to handle this scenario?

Thanks in advance
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions