Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CPyCppyy] Avoid holding reference to
__main__
in the CPyCppyy API
The `gMainDict` should be borrowed, i.e. we are not calling Py_INCREF(gMainDict). Like this, we avoid unexpectedly affecting how long `__main__` is kept alive. The `gMainDict` is only used in `Exec()`, `ExecScript()`, and `Eval()`, which should not be called after `__main__` is garbage collected anyway.
- Loading branch information