mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
minor fixes & removed a leak when freeing functions
This commit is contained in:
parent
b2c2c79240
commit
95d18691c9
@ -341,7 +341,6 @@ private:
|
|||||||
static void destruct(function_entry *entry) {
|
static void destruct(function_entry *entry) {
|
||||||
while (entry) {
|
while (entry) {
|
||||||
function_entry *next = entry->next;
|
function_entry *next = entry->next;
|
||||||
delete entry->def;
|
|
||||||
if (entry->free_data)
|
if (entry->free_data)
|
||||||
entry->free_data(entry->data);
|
entry->free_data(entry->data);
|
||||||
std::free((char *) entry->name);
|
std::free((char *) entry->name);
|
||||||
@ -352,6 +351,10 @@ private:
|
|||||||
std::free((char *) arg.descr);
|
std::free((char *) arg.descr);
|
||||||
Py_XDECREF(arg.value);
|
Py_XDECREF(arg.value);
|
||||||
}
|
}
|
||||||
|
if (entry->def) {
|
||||||
|
free((char *) entry->def->ml_doc);
|
||||||
|
delete entry->def;
|
||||||
|
}
|
||||||
delete entry;
|
delete entry;
|
||||||
entry = next;
|
entry = next;
|
||||||
}
|
}
|
||||||
@ -410,7 +413,7 @@ private:
|
|||||||
signature += c;
|
signature += c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type_depth != 0 && types[type_index ] != nullptr)
|
if (type_depth != 0 || types[type_index] != nullptr)
|
||||||
throw std::runtime_error("Internal error while parsing type signature (2)");
|
throw std::runtime_error("Internal error while parsing type signature (2)");
|
||||||
|
|
||||||
#if !defined(PYBIND11_CPP14)
|
#if !defined(PYBIND11_CPP14)
|
||||||
|
Loading…
Reference in New Issue
Block a user