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);
}