All contents in braces shall be released after the end of braces.
By that, It means I should get Exactly using memory by "Done!" as same as "Start!".
However there's 500MB memory leaked.
I ran a few cases to test, hope this would help:
If I close the program, all leaked memory will be released.
If I put those code into a function(see below), every time I call "func()" there will be 500MB memory leaked.
=> 2 call = 1000MB
=> 3 call = 1500MB and so on.
Here's my code.
All contents in braces shall be released after the end of braces.
By that, It means I should get Exactly using memory by "Done!" as same as "Start!".
However there's 500MB memory leaked.
I ran a few cases to test, hope this would help:
=> 2 call = 1000MB
=> 3 call = 1500MB and so on.
Is there anything wrong with the code I wrote?