c++ - Memory leak with shared pointers? -


i have structure of code :

class base {     //maps, sets on stack     //maps, set shared pointers };  int main() {      for(int i=0;i<10;i++)      {          try          {              boost::shared_ptr<base> b(new base(....));              b.func()          }          catch exception          {              print exception          }             //some more functionality      } } 

in case, func throws exception (assume always), getting continuous increase in memory leak of ~15-16 mb each iteration. can point out may helpful?

is because of throwing exception? have checked code, don't see fishy.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -