Mantid
Loading...
Searching...
No Matches
UninstallTrace.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8
10
16 PyThreadState *curThreadState = PyThreadState_GET();
17 m_tracefunc = curThreadState->c_tracefunc;
18 m_tracearg = curThreadState->c_traceobj;
19 Py_XINCREF(m_tracearg);
20 PyEval_SetTrace(nullptr, nullptr);
21}
22
28
29} // namespace Mantid::PythonInterface
~UninstallTrace()
Reinstates any trace function with PyEval_SetTrace and any saved arguments from the constructor.
UninstallTrace()
Saves any function and argument previously set by PyEval_SetTrace and calls PyEval_SetTrace(nullptr,...