Question about source plugin destructor call

Hi all,

I’am currently trying to understand why, when i delete a source (built from one of our plugin) with a right click on it in the pipeline browser, its destructor is not called. In fact i see it get called only when i’m closing totally ParaView.

Thanks in advance for your response

Hi @guillaume_Peillex

I’m unable to reproduce with a simple line source, here is what I get when deleting it in the pipeline:

Thread 1 "paraview" hit Breakpoint 1, vtkLineSource::~vtkLineSource (this=0x55555e97c410, __in_chrg=<optimized out>) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Sourc                                                                                                                                                                                  ø¨€‚  ø¨€‚ ý¿¿¿¿¿es/vtkLineSource.cxx:57                                                                                                                                                                                                                                                                                                                                    ø €‚€ 
57        this->SetPoints(nullptr);                                                                                                                                                                                                                                                                                     
(gdb) bt                                                                                                                                                                                                    
#0  vtkLineSource::~vtkLineSource (this=0x55555e97c410, __in_chrg=<optimized out>) at /home/glow/dev/paraview/pv1/src/VTK/Filters/Sources/vtkLineSource.cxx:57                                                                                                                                                                                             ø €‚€ ø €‚€ý¿¿¿¿¿
#1  0x00007ffff2f42728 in vtkLineSource::~vtkLineSource (this=0x55555e97c410, __in_chrg=<optimized out>)                                                                                                                                                                                                                                                   ø €‚€ ø €‚€ý¿¿¿¿¿
    at /home/glow/dev/paraview/pv1/src/VTK/Filters/Sources/vtkLineSource.cxx:58                                                                                                                                                                                                                                                                            ø €‚€ ø €‚€ý¿¿¿¿¿
#2  0x00007fffee2d515f in vtkObjectBase::UnRegisterInternal (this=0x55555e97c410, check=0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:345                                                                                                                                                                                      𧕑  ýžœž 啬ý¿¿¿¿¿
#3  0x00007fffee2d2c1b in vtkObject::UnRegisterInternal (this=0x55555e97c410, o=0x7fffffffb820, check=0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObject.cxx:927
#4  0x00007fffee2024cd in vtkGarbageCollectorToObjectBaseFriendship::UnRegister (obj=0x55555e97c410, from=0x7fffffffb820)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkGarbageCollector.cxx:141
#5  0x00007fffee2004e0 in vtkGarbageCollectorImpl::CollectComponent (this=0x7fffffffb820, c=0x55555e9a0e90)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkGarbageCollector.cxx:702
#6  0x00007fffee1ff470 in vtkGarbageCollectorImpl::CollectInternal (this=0x7fffffffb820, root=0x55555e97c410)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkGarbageCollector.cxx:480
#7  0x00007fffee2019e5 in vtkGarbageCollector::Collect (root=0x55555e97c410) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkGarbageCollector.cxx:899
#8  0x00007fffee2d5173 in vtkObjectBase::UnRegisterInternal (this=0x55555e97c410, check=1) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:353
#9  0x00007fffee2d2c1b in vtkObject::UnRegisterInternal (this=0x55555e97c410, o=0x0, check=1) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObject.cxx:927
#10 0x00007fffee2d4ff9 in vtkObjectBase::UnRegister (this=0x55555e97c410, o=0x0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:300
#11 0x00007fffee3c79ab in vtkSmartPointerBase::~vtkSmartPointerBase (this=0x7fffffffbb40, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkSmartPointerBase.cxx:61
#12 0x00007fffee3c7a0c in vtkSmartPointerBase::operator= (this=0x55555eaa1d28, r=0x0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkSmartPointerBase.cxx:75
#13 0x00007ffff52fc11e in vtkSmartPointer<vtkObjectBase>::operator= (this=0x55555eaa1d28, r=...) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkSmartPointer.h:145
#14 0x00007ffff532e57b in vtkSIProxy::DeleteVTKObjects (this=0x55555eaa1c80) at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSIProxy.cxx:402
#15 0x00007ffff532c1e9 in vtkSIProxy::~vtkSIProxy (this=0x55555eaa1c80, __in_chrg=<optimized out>) at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSIProxy.cxx:100
#16 0x00007ffff534a23c in vtkSISourceProxy::~vtkSISourceProxy (this=0x55555eaa1c80, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSISourceProxy.cxx:68
#17 0x00007ffff534a25c in vtkSISourceProxy::~vtkSISourceProxy (this=0x55555eaa1c80, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSISourceProxy.cxx:68
#18 0x00007fffee2d515f in vtkObjectBase::UnRegisterInternal (this=0x55555eaa1c80, check=0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:345
#19 0x00007fffee2d2c1b in vtkObject::UnRegisterInternal (this=0x55555eaa1c80, o=0x0, check=0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObject.cxx:927
#20 0x00007fffee2d4ff9 in vtkObjectBase::UnRegister (this=0x55555eaa1c80, o=0x0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:300
#21 0x00007ffff52f995d in vtkPVSessionCore::vtkInternals::UnRegisterSI (this=0x555555f0dfe0, globalUniqueId=14200, origin=0)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkPVSessionCore.cxx:129
#22 0x00007ffff52f7726 in vtkPVSessionCore::UnRegisterSIObjectInternal (this=0x555555f34fc0, message=0x7fffffffbea0)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkPVSessionCore.cxx:749
#23 0x00007ffff52f6efa in vtkPVSessionCore::UnRegisterSIObject (this=0x555555f34fc0, message=0x7fffffffbea0)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkPVSessionCore.cxx:698
#24 0x00007ffff52f262b in vtkPVSessionBase::UnRegisterSIObject (this=0x555555f3f400, msg=0x7fffffffbea0)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkPVSessionBase.cxx:185
#25 0x00007ffff52f2b8a in vtkPVSessionBase::UnRegisterRemoteObject (this=0x555555f3f400, gid=14200, location=21)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkPVSessionBase.cxx:276
#26 0x00007ffff54adba5 in vtkSMRemoteObject::~vtkSMRemoteObject (this=0x55555e204cf0, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSMRemoteObject.cxx:41
#27 0x00007ffff545f9c4 in vtkSMProxy::~vtkSMProxy (this=0x55555e204cf0, __in_chrg=<optimized out>) at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSMProxy.cxx:166
#28 0x00007ffff54ea924 in vtkSMSourceProxy::~vtkSMSourceProxy (this=0x55555e204cf0, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSMSourceProxy.cxx:146
#29 0x00007ffff54ea944 in vtkSMSourceProxy::~vtkSMSourceProxy (this=0x55555e204cf0, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSMSourceProxy.cxx:146
#30 0x00007fffee2d515f in vtkObjectBase::UnRegisterInternal (this=0x55555e204cf0, check=0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:345
#31 0x00007fffee2d2c1b in vtkObject::UnRegisterInternal (this=0x55555e204cf0, o=0x0, check=0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObject.cxx:927
#32 0x00007fffee2d4ff9 in vtkObjectBase::UnRegister (this=0x55555e204cf0, o=0x0) at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkObjectBase.cxx:300
#33 0x00007fffee3c79ab in vtkSmartPointerBase::~vtkSmartPointerBase (this=0x55555e208120, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkSmartPointerBase.cxx:61
#34 0x00007ffff538121e in vtkSmartPointer<vtkSMProxy>::~vtkSmartPointer (this=0x55555e208120, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/VTK/Common/Core/vtkSmartPointer.h:36
#35 0x00007ffff5483822 in vtkSMProxyInfo::~vtkSMProxyInfo (this=0x55555e208120, __in_chrg=<optimized out>)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSMProxyListDomain.cxx:68
#36 0x00007ffff5486a21 in std::_Destroy<vtkSMProxyInfo> (__pointer=0x55555e208120) at /usr/include/c++/12.2.0/bits/stl_construct.h:151
#37 0x00007ffff548623e in std::_Destroy_aux<false>::__destroy<vtkSMProxyInfo*> (__first=0x55555e208120, __last=0x55555e2081a0)
    at /usr/include/c++/12.2.0/bits/stl_construct.h:163
#38 0x00007ffff5485862 in std::_Destroy<vtkSMProxyInfo*> (__first=0x55555e2080a0, __last=0x55555e2081a0) at /usr/include/c++/12.2.0/bits/stl_construct.h:196
#39 0x00007ffff5484ea1 in std::_Destroy<vtkSMProxyInfo*, vtkSMProxyInfo> (__first=0x55555e2080a0, __last=0x55555e2081a0) at /usr/include/c++/12.2.0/bits/alloc_traits.h:850
#40 0x00007ffff5484e25 in std::vector<vtkSMProxyInfo, std::allocator<vtkSMProxyInfo> >::_M_erase_at_end (this=0x55555dda3c98, __pos=0x55555e2080a0)
    at /usr/include/c++/12.2.0/bits/stl_vector.h:1932
#41 0x00007ffff54841be in std::vector<vtkSMProxyInfo, std::allocator<vtkSMProxyInfo> >::clear (this=0x55555dda3c98) at /usr/include/c++/12.2.0/bits/stl_vector.h:1601
#42 0x00007ffff5483bba in vtkSMProxyListDomainInternals::ClearProxies (this=0x55555dda3c80)
    at /home/glow/dev/paraview/pv1/src/Remoting/ServerManager/vtkSMProxyListDomain.cxx:235

So more info will be needed.

@mwestphal thanks for your answer. I will investigate a bit and try to have a small reproducer to ease the investigation.