Skip to content

Commit

Permalink
fix potential memory leak with virtual destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
leovandriel committed Mar 15, 2018
1 parent c8738ba commit 02952da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/caffe2/util/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ModelUtil {
ModelUtil(NetDef &init_net, NetDef &predict_net,
const std::string &name = "");
ModelUtil(NetUtil &init, NetUtil &predict);
~ModelUtil();
virtual ~ModelUtil();

void AddDatabaseOps(const std::string &name, const std::string &data,
const std::string &db, const std::string &db_type,
Expand Down
2 changes: 1 addition & 1 deletion src/cvplot/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Trans {

Trans(cv::Mat &buffer, int alpha) : Trans(buffer) { setup(alpha); }

~Trans() { flush(); }
virtual ~Trans() { flush(); }

cv::Mat &get() const { return (interim_ != NULL ? *interim_ : original_); }

Expand Down

0 comments on commit 02952da

Please sign in to comment.