Skip to content

How to free up the memory correctly? #15

Description

@rafaelcapucho

I know that there is the .Clear() method to call, but how should I do when I have nested structures like this:

CJAVal json_positions_list;

for(...){
      CJAVal json_position;

      json_position["account_number"] = account_number;
      json_position["takeprofit"] = takeprofit;
      json_position["digits"] = digits;
      
      json_positions_list.Add(json_position);
}

Calling json_positions_list.Clear() will also free the memory of the internals json_position elements?

Should I iterate of json_positions_list and free the memory one by one?

I want to get rid of json_positions_list memory entirely, would a delete json_positions_list works? I read that the delete command only works when the object is created using the new statement,

@vivazzi Any help is appreciated, Thanks!

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