Open
Description
The following script shows the problem:
import peakingduck as pd
data = pd.core.NumericalData([2,3.4,5,123.,123.2,6453.42,3.5,345.34,23.4,524.542,89.3])
pm = pd.core.SimpleProcessManager()
# this causes problems, due to Python ref counting
# comment it out to find out
#pm.append(pd.core.SavitzkyGolaySmoother(3))
# this also causes issues
#sg = pd.core.SavitzkyGolaySmoother(3)
#pm.append(sg)
#del sg
# this is OK, since it is fro C++
pm.append(pd.core.MovingAverageSmoother(3))
# process the data
processeddata = pm.run(data).to_list()
print(processeddata)
Related to:
- shared_ptrs to Python-derived instances outlive the associated Python object pybind/pybind11#1546
- Ownership of python objects inheriting from C++ classes pybind/pybind11#1389
- Fix Python object lifetimes associated with shared_ptrs pybind/pybind11#1566
- Question about returning unique pointer in virtual function pybind/pybind11#673
Metadata
Metadata
Assignees
Labels
No labels