Browse Source

Gmt module: Fix memory leak, pointer returned by Get() must be deleted, so, use Find() instead.

ObjPtr
Michael Uleysky 8 years ago
parent
commit
b3c59f832d
  1. 2
      modules/gmt/modgmt_func.h

2
modules/gmt/modgmt_func.h

@ -21,7 +21,7 @@ class Base2Something: public OBTypeM<Func,O...>
public:
Base2Something(const ObjectBase* arg):OBTypeM<Func,O...>(arg) {};
Base2Something(const ObjectList* input, const std::string& name):OBTypeM<Func,O...>(input->Get(name)){};
Base2Something(const ObjectList* input, const std::string& name):OBTypeM<Func,O...>(input->Find(name)){};
Base2Something(const ObjectList* input, const ObjectList::ListValues::size_type i):OBTypeM<Func,O...>((i<input->Size())?input->At(i):0){}; // Check index, because At is not safe
template<class... Args>
auto operator ()(bool* b, Args... args) const -> decltype(this->OBTypeM<Func,O...>::template operator()<bool*, Args...>(b, args...))

Loading…
Cancel
Save