Skip to content
Snippets Groups Projects
Commit 27a9e574 authored by Sergey Linev's avatar Sergey Linev
Browse files

[cppyy] fix potential double-deletion in CPPMethod #7692

After use of asign operator some fields can be destroyed twice
parent f439cc1d
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ inline void CPyCppyy::CPPMethod::Copy_(const CPPMethod& /* other */) ...@@ -45,7 +45,7 @@ inline void CPyCppyy::CPPMethod::Copy_(const CPPMethod& /* other */)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
inline void CPyCppyy::CPPMethod::Destroy_() const inline void CPyCppyy::CPPMethod::Destroy_()
{ {
// destroy executor and argument converters // destroy executor and argument converters
if (fExecutor && fExecutor->HasState()) delete fExecutor; if (fExecutor && fExecutor->HasState()) delete fExecutor;
...@@ -55,6 +55,11 @@ inline void CPyCppyy::CPPMethod::Destroy_() const ...@@ -55,6 +55,11 @@ inline void CPyCppyy::CPPMethod::Destroy_() const
} }
delete fArgIndices; delete fArgIndices;
fExecutor = nullptr;
fArgIndices = nullptr;
fConverters.clear();
fArgsRequired = -1;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -61,7 +61,7 @@ protected: ...@@ -61,7 +61,7 @@ protected:
private: private:
void Copy_(const CPPMethod&); void Copy_(const CPPMethod&);
void Destroy_() const; void Destroy_();
PyObject* ExecuteFast(void*, ptrdiff_t, CallContext*); PyObject* ExecuteFast(void*, ptrdiff_t, CallContext*);
PyObject* ExecuteProtected(void*, ptrdiff_t, CallContext*); PyObject* ExecuteProtected(void*, ptrdiff_t, CallContext*);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment