help wanted
仓库指标
- Star
- (14,677 star)
- PR 合并指标
- (平均合并 5天 2小时) (30 天内合并 10 个 PR)
描述
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
Problem description
Dear team, Asan reports possible memory leaks when wrapping enum from C++ (using py::enum_, precisely when a call to the value method is done.
Wrapping struct (using py::class_) seems to raise no leaks.
Config : python3.8 / gcc8.3, pybind v2.9.2
May be related to https://github.com/pybind/pybind11/issues/3228
Reproducible example code
#include <pybind11/pybind11.h>
enum Egg {
Bar,
Spam,
};
namespace py = pybind11;
PYBIND11_MODULE(example, m) {
py::enum_<Egg>(m, "Egg")
.value("Bar", Egg::Bar)
.value("Spam", Egg::Spam);
}