You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes a memory leak in native code and a regression. #46735
This patch fixes a leak caused by errors in the native code and a regression
caused by a previous tentative of a fix for another leak.
The leak occurs in qi objects bound functions arguments conversion. It was not
clear whether `qi::StructTypeInterface` subclasses implementations of its `get`
methods should return owned pointers or not (i.e. if the caller of these
methods was expected to destroy these pointers). It seems after research that
they must not, and our `StructuredIterableInterface` subtype implementation was
wrong. These methods are reimplemented by this patch.
The regression was caused by a previous fix. The fix (commit "a072133") aimed
at resolving a leak that concerned qi objects containing properties or signals,
which were kept alive after the Python object holding them was destroyed. This
fix introduced a regression that prevented users to call functions of
properties from temporary objects.
Therefore, this patch reverts that commit. After further research, it was found
that the leak is caused by objects being instantiated on the heap when we
thought `pybind11` took ownership of these, which is not the case. Instead, the
objects are now instantiated on the stack.
0 commit comments