<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
vtk doesn't use thread to do garbage collection. You have too thread running vtk code and your crashes are most likely related to a race condition.<br><br><br> <BR><div><hr id="stopSpelling">Date: Wed, 7 Sep 2011 14:14:48 -0700<br>Subject: Re: [vtkusers] Help with crashes in VTK<br>From: jonmorra@gmail.com<br>To: xf10036@hotmail.com; david.gobbi@gmail.com<br>CC: vtkusers@vtk.org<br><br>So I was playing around with removing vtkSmartPointers passed by reference to see if that fixed my issue.<div>1. Would passing a vtkSmartPointer by const reference be an issue?</div><div>2. I got the following crash outlined below. It does not reference any code I wrote at all. Also in my debugger it says that there are 2 vtk garbage collection threads running. My understanding of smart pointers is that a garbage collector is unnecessary because if the reference count = 0 then the object is removed. Also, what could cause this crash?</div>
<div><br></div><div>Thread 1 stack trace</div><div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>cccccccc()<span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x0687f280) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x179ff5f4) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f82880, void * ptr=0x04047640) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f82880, void * ptr=0x04047640, const char * __formal=0x6490d51c) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * obj=0x03f82880, void * ptr=0x04047640, const char * desc=0x6490d51c) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkGarbageCollectorReport<vtkInformation>(vtkGarbageCollector * collector=0x179ffd90, vtkInformation * & ptr=, const char * desc=0x6490d51c) Line 201 + 0x18 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkDataObject::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 1022<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkPointSet::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 351<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x0687f168) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x179ff718) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x04047618, void * ptr=0x06bf9270) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x04047618, void * ptr=0x06bf9270, const char * __formal=0x6490cc14) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * obj=0x04047618, void * ptr=0x06bf9270, const char * desc=0x6490cc14) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReport<vtkObjectBase>(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * & ptr=, const char * desc=0x6490cc14) Line 201 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformation::ReportAsObjectBase(vtkInformationKey * key=0x03ef5f78, vtkGarbageCollector * collector=0x179ffd90) Line 826 + 0x16 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformationKey::ReportAsObjectBase(vtkInformation * info=0x03f86bd8, vtkGarbageCollector * collector=0x179ffd90) Line 136<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformation::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 812 + 0xc bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x0687f248) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x179ff864) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f86bd8, void * ptr=0x03f84698) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f86bd8, void * ptr=0x03f84698, const char * __formal=0x6571055c) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * obj=0x03f86bd8, void * ptr=0x03f84698, const char * desc=0x6571055c) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReport<vtkInformation>(vtkGarbageCollector * collector=0x179ffd90, vtkInformation * & ptr=, const char * desc=0x6571055c) Line 201 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformationVector::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 227 + 0x28 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06983e58) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x179ff980) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f85968, void * ptr=0x03c6bb08) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f85968, void * ptr=0x03c6bb08, const char * __formal=0x64910f5c) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * obj=0x03f85968, void * ptr=0x03c6bb08, const char * desc=0x64910f5c) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkGarbageCollectorReport<vtkInformationVector>(vtkGarbageCollector * collector=0x179ffd90, vtkInformationVector * & ptr=, const char * desc=0x64910f5c) Line 201 + 0x18 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkExecutive::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 306 + 0xf bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06983c60) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x179ffa9c) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03c6bae0, void * ptr=0x03fd5f44) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03c6bae0, void * ptr=0x03fd5f44, const char * __formal=0x64910cac) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * obj=0x03c6bae0, void * ptr=0x03fd5f44, const char * desc=0x64910cac) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReport<vtkObjectBase>(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * & ptr=, const char * desc=0x64910cac) Line 201 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkSmartPointerBase::Report(vtkGarbageCollector * collector=0x179ffd90, const char * desc=0x64910cac) Line 96 + 0x10 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkInformationExecutivePortKey::Report(vtkInformation * info=0x03f84158, vtkGarbageCollector * collector=0x179ffd90) Line 157 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformation::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 812 + 0xc bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06983d08) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x179ffbe0) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f84158, void * ptr=0x04047464) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f84158, void * ptr=0x04047464, const char * __formal=0x6490d504) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x179ffd90, vtkObjectBase * obj=0x03f84158, void * ptr=0x04047464, const char * desc=0x6490d504) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkGarbageCollectorReport<vtkInformation>(vtkGarbageCollector * collector=0x179ffd90, vtkInformation * & ptr=, const char * desc=0x6490d504) Line 201 + 0x18 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkDataObject::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 1022 + 0xf bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkPointSet::ReportReferences(vtkGarbageCollector * collector=0x179ffd90) Line 351<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06983b48) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div>><span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x02fe0000) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>kernel32.dll!762214dd() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]<span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>msvcr90.dll!73193c3a() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>msvcr90.dll!731534c7() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>kernel32.dll!7622339a() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>ntdll.dll!76f69ed2() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>ntdll.dll!76f69ea5() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div></div><div><br></div><div>Thread 2 stack trace</div><div><span style="white-space: pre;" class="ecxApple-tab-span">        </span><span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06718db8) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x17aff5f4) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f82880, void * ptr=0x04047640) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f82880, void * ptr=0x04047640, const char * __formal=0x6490d51c) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * obj=0x03f82880, void * ptr=0x04047640, const char * desc=0x6490d51c) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkGarbageCollectorReport<vtkInformation>(vtkGarbageCollector * collector=0x17affd90, vtkInformation * & ptr=, const char * desc=0x6490d51c) Line 201 + 0x18 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkDataObject::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 1022<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkPointSet::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 351<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06679c80) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x17aff718) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x04047618, void * ptr=0x06bf9270) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x04047618, void * ptr=0x06bf9270, const char * __formal=0x6490cc14) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * obj=0x04047618, void * ptr=0x06bf9270, const char * desc=0x6490cc14) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReport<vtkObjectBase>(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * & ptr=, const char * desc=0x6490cc14) Line 201 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformation::ReportAsObjectBase(vtkInformationKey * key=0x03ef5f78, vtkGarbageCollector * collector=0x17affd90) Line 826 + 0x16 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformationKey::ReportAsObjectBase(vtkInformation * info=0x03f86bd8, vtkGarbageCollector * collector=0x17affd90) Line 136<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformation::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 812 + 0xc bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06679c10) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x17aff864) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f86bd8, void * ptr=0x03f84698) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f86bd8, void * ptr=0x03f84698, const char * __formal=0x6571055c) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * obj=0x03f86bd8, void * ptr=0x03f84698, const char * desc=0x6571055c) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReport<vtkInformation>(vtkGarbageCollector * collector=0x17affd90, vtkInformation * & ptr=, const char * desc=0x6571055c) Line 201 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformationVector::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 227 + 0x28 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x06717548) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x17aff980) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f85968, void * ptr=0x03c6bb08) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f85968, void * ptr=0x03c6bb08, const char * __formal=0x64910f5c) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * obj=0x03f85968, void * ptr=0x03c6bb08, const char * desc=0x64910f5c) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkGarbageCollectorReport<vtkInformationVector>(vtkGarbageCollector * collector=0x17affd90, vtkInformationVector * & ptr=, const char * desc=0x64910f5c) Line 201 + 0x18 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkExecutive::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 306 + 0xf bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x067174d8) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x17affa9c) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03c6bae0, void * ptr=0x03fd6624) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03c6bae0, void * ptr=0x03fd6624, const char * __formal=0x64910cac) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * obj=0x03c6bae0, void * ptr=0x03fd6624, const char * desc=0x64910cac) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReport<vtkObjectBase>(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * & ptr=, const char * desc=0x64910cac) Line 201 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkSmartPointerBase::Report(vtkGarbageCollector * collector=0x17affd90, const char * desc=0x64910cac) Line 96 + 0x10 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkInformationExecutivePortKey::Report(vtkInformation * info=0x03f84b30, vtkGarbageCollector * collector=0x17affd90) Line 157 + 0x17 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkInformation::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 812 + 0xc bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x067173f8) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x17affbe0) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f84b30, void * ptr=0x04046ce4) Line 639<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::Report(vtkObjectBase * obj=0x03f84b30, void * ptr=0x04046ce4, const char * __formal=0x6490d504) Line 602<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorReportInternal(vtkGarbageCollector * collector=0x17affd90, vtkObjectBase * obj=0x03f84b30, void * ptr=0x04046ce4, const char * desc=0x6490d504) Line 1069<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkGarbageCollectorReport<vtkInformation>(vtkGarbageCollector * collector=0x17affd90, vtkInformation * & ptr=, const char * desc=0x6490d504) Line 201 + 0x18 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkDataObject::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 1022 + 0xf bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkFiltering.dll!vtkPointSet::ReportReferences(vtkGarbageCollector * collector=0x17affd90) Line 351<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::VisitTarjan(vtkObjectBase * obj=0x067175f0) Line 552<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div>><span style="white-space: pre;" class="ecxApple-tab-span">        </span>vtkCommon.dll!vtkGarbageCollectorImpl::MaybeVisit(vtkObjectBase * obj=0x00000000) Line 522 + 0x8 bytes<span style="white-space: pre;" class="ecxApple-tab-span">        </span>C++</div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>QtGui4.dll!009284f2() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>kernel32.dll!762214dd() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>msvcr90.dll!73193c3a() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>msvcr90.dll!731534c7() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>kernel32.dll!7622339a() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div><div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>ntdll.dll!76f69ed2() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div>
<div> <span style="white-space: pre;" class="ecxApple-tab-span">        </span>ntdll.dll!76f69ea5() <span style="white-space: pre;" class="ecxApple-tab-span">        </span></div></div><div><br></div><div><br><div class="ecxgmail_quote">On Wed, Sep 7, 2011 at 9:45 AM, Xiaofeng Z <span dir="ltr"><<a href="mailto:xf10036@hotmail.com">xf10036@hotmail.com</a>></span> wrote:<br>
<blockquote style="padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="ecxgmail_quote">
<div><div dir="ltr"><div class="ecxim">
>I've been using vtkImageData::New(), followed by vtkImageData->DeepCopy(filter->GetOutput()). I've been doing this cause I notice that once I delete the filter the output no longer exists.<br></div><div>
<div> </div><div>Don't deep copy the image, instead do:</div><div> </div><div> vtkImageData* filterOutput = filter->GetOutput();</div><div> filterOutput->Register(0); // increment the ref count</div><div>
</div><div>to keep the output in the memory.</div><div> </div><div>Just make sure you pair off every New() or Register() with a Delete().</div><div> </div><div>BTW, I'm not for or against the use of smart pointer for any fundamental reason. If one knows very well how a smart pointer class works, using the smart pointer to left the burden of tracking memory allocation can be very helpful. When I do decided to use smart pointer, I use it exclusively, much like in Java where every variable is a managed smart pointer. Mixing the usage of smart pointers and naked pointers is where trouble comes in.</div>
<div> </div><div>HTH</div><div class="ecxim"><div><br><div>On Tue, Sep 6, 2011 at 11:55 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote style="padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div><div>On Tue, Sep 6, 2011 at 12:34 PM, Jonathan Morra <span dir="ltr"><<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>></span> wrote:<br>
<div><blockquote style="padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
This could make sense, I'm going to try and change all my method signatures to pass around const references to vtkSmartPointers where appropriate. Do you know what happens to the reference count upon returning a vtkSmartPointer?</blockquote>
</div><br></div><div><br></div></div><div>In VTK, smart pointers should only be used to store references, not to pass them. VTK methods should take regular pointers as arguments.</div><div><br></div><div>The general rules are:</div>
<div><br></div><div>1) Refcounts are not automatically incremented when objects are returned, i.e. when an object is returned to you, then you are just "borrowing" it. If you need to own it for a while, then store it in a smart pointer.</div>
<div><br></div><div>2) Refcounts are not automatically incremented when objects are passed to a method. If a method needs to own the object for a while, it should store it in a smart pointer. All methods in the VTK libraries that need to own the objects that are passed to them will increment the refcount of those objects, either by storing it in a smart pointer or by calling Register() on it.</div>
<div><br></div><div>There are a few very rare exceptions to rule #1, such as the NewInstance() method.</div><div><br></div><font color="#888888"><div> - David</div>
</font></blockquote></div><br></div></div></div>                                            </div></div>
</blockquote></div><br></div></div>                                            </div></body>
</html>