)]}'
{
  "commit": "dd95d53f0a55ba166940f2a67c07150521202b4b",
  "tree": "4197563c853e4bd303bedecba1c6840a386d45f1",
  "parents": [
    "0a45af2531d5d8a05fddac62dea25cfa222966ce"
  ],
  "author": {
    "name": "Yury Matveev",
    "email": "43314316+yamatveev@users.noreply.github.com",
    "time": "Tue Mar 24 05:14:00 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Mar 24 11:14:00 2026 +0700"
  },
  "message": "Fix memory leak: clear managed dict in pybind11_object_dealloc on Python 3.13+          (#5999)\n\n* fix: clear managed dict in pybind11_object_dealloc on Python 3.13+\n\nOn Python 3.14, PyObject_GC_Del (tp_free) no longer implicitly clears\nthe managed dict of objects with Py_TPFLAGS_MANAGED_DICT. Without an\nexplicit PyObject_ClearManagedDict() call before tp_free(), objects\nstored in the __dict__ of py::dynamic_attr() instances have their\nrefcounts permanently abandoned, causing memory leaks — capsule\ndestructors for numpy arrays (and other objects) never run.\n\nAdds a regression test: stores a py::capsule in the __dict__ of a\nDynamicClass instance and asserts the capsule destructor is called\nwhen the instance is deleted.\n\n* [tests]: mark test_dynamic_attr_dealloc_frees_dict_contents to be strict\u003dFalse xfail on PYPY\n\n* [docs]: clarify Python version comments in pybind11_object_dealloc\n\nDistinguish between when the API is available (3.13+, where\nPyObject_ClearManagedDict was introduced) and when the leak actually\nmanifests (3.14+, where tp_free stopped implicitly clearing the\nmanaged dict).\n\n---------\n\nCo-authored-by: Yury Matveev \u003cyury.matveev@desy.de\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "480c369aa65436abfa88479cc784f0d86a80a6e2",
      "old_mode": 33188,
      "old_path": "include/pybind11/detail/class.h",
      "new_id": "4b7422eee25ad458c1b575e200eca56a3cd79a88",
      "new_mode": 33188,
      "new_path": "include/pybind11/detail/class.h"
    },
    {
      "type": "modify",
      "old_id": "f5fb02d121dbb2576b1ae16dd45bfe6ec97ae440",
      "old_mode": 33188,
      "old_path": "tests/test_methods_and_attributes.cpp",
      "new_id": "a72d18792d4773b8af8dc11da447b26c08b3ca6d",
      "new_mode": 33188,
      "new_path": "tests/test_methods_and_attributes.cpp"
    },
    {
      "type": "modify",
      "old_id": "553d5bfc1bad317e2f9455f4cecea6d993aa371e",
      "old_mode": 33188,
      "old_path": "tests/test_methods_and_attributes.py",
      "new_id": "ef0e7ac5170dbe6bba655ce86d712e29d2c03827",
      "new_mode": 33188,
      "new_path": "tests/test_methods_and_attributes.py"
    }
  ]
}
