■ ■ ■ ■ ■ ■
api/python/src/pyLIEF.cpp
| skipped 145 lines |
146 | 146 | | m.attr("__is_tagged__") = bool(LIEF_TAGGED); |
147 | 147 | | m.doc() = "LIEF Python API"; |
148 | 148 | | |
| 149 | + | m.def("disable_leak_warning", [] { |
| 150 | + | nb::set_leak_warnings(false); |
| 151 | + | }, R"doc( |
| 152 | + | Disable nanobind warnings about leaked objects. |
| 153 | + | For instance: |
| 154 | + | |
| 155 | + | .. code-block:: text |
| 156 | + | |
| 157 | + | nanobind: leaked 45 instances! |
| 158 | + | nanobind: leaked 25 types! |
| 159 | + | - leaked type "lief._lief.FORMATS" |
| 160 | + | - ... skipped remainder |
| 161 | + | nanobind: leaked 201 functions! |
| 162 | + | - leaked function "" |
| 163 | + | - leaked function "export_symbol" |
| 164 | + | - ... skipped remainder |
| 165 | + | nanobind: this is likely caused by a reference counting issue in the binding code. |
| 166 | + | )doc"); |
| 167 | + | |
149 | 168 | | LIEF::py::init_python_sink(); |
150 | 169 | | |
151 | 170 | | LIEF::py::init_platforms(m); |
| skipped 42 lines |