Mercurial > hg > orthanc-python
comparison Sources/PythonFunction.cpp @ 13:952e969a2240
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 01 Apr 2020 08:19:13 +0200 |
parents | 7ed502b17b8f |
children | fd58eb5749ed |
comparison
equal
deleted
inserted
replaced
12:0b8239ce1bec | 13:952e969a2240 |
---|---|
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 PythonFunction::PythonFunction(PythonLock& lock, | 41 PythonFunction::PythonFunction(PythonLock& lock, |
42 PythonModule& module, | 42 const PythonModule& module, |
43 const std::string& name) : | 43 const std::string& name) : |
44 lock_(lock) | 44 lock_(lock) |
45 { | 45 { |
46 if (module.IsValid() && | 46 if (module.IsValid() && |
47 // This check is necessary in Python 2.7, otherwise garbage collector might crash | 47 // This check is necessary in Python 2.7, otherwise garbage collector might crash |
76 return result.release(); | 76 return result.release(); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 PythonObject* PythonFunction::Call(PythonObject& args) | 81 PythonObject* PythonFunction::Call(const PythonObject& args) |
82 { | 82 { |
83 std::unique_ptr<PythonObject> result(CallUnchecked(args.GetPyObject())); | 83 std::unique_ptr<PythonObject> result(CallUnchecked(args.GetPyObject())); |
84 | 84 |
85 std::string error; | 85 std::string error; |
86 if (lock_.HasErrorOccurred(error)) | 86 if (lock_.HasErrorOccurred(error)) |