Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to free up the memory correctly? #15

Open
rafaelcapucho opened this issue Feb 18, 2024 · 0 comments
Open

How to free up the memory correctly? #15

rafaelcapucho opened this issue Feb 18, 2024 · 0 comments

Comments

@rafaelcapucho
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant