<div dir="ltr"><div><div><div><div><div><div>Dear mailing list,<br><br></div><div><br>I&#39;m running into a problem involving vtkSmartPointer and valgrind complaints.<br><br></div>Here is a minimal code example of what doesn&#39;t seem to work:<br>
<br></div><div>======== main.cpp ===========<br></div><div>#include &lt;vtkSmartPointer.h&gt;<br>#include &lt;vtkDataSetMapper.h&gt;<br><br>int main(int argc, char ** argv)<br>{<br>    vtkSmartPointer&lt;vtkDataSetMapper&gt; dataSetMapper = vtkSmartPointer&lt;vtkDataSetMapper&gt;::New();<br>
<br>    return 0;<br>}<br>======== CMakeLists.txt ===========<br>cmake_minimum_required(VERSION 2.8)<br>project(main)<br><br>set(CMAKE_BUILD_TYPE Debug)<br>set(CMAKE_CXX_FLAGS_DEBUG &quot;${CMAKE_CXX_FLAGS_DEBUG} -Wall&quot;)<br>
<br>find_package(VTK REQUIRED)<br>include(${VTK_USE_FILE})<br><br>add_executable(main main.cpp)<br><br>target_link_libraries(main ${VTK_LIBRARIES})<br>======================<br><br></div>Both cmake and compiling run fine. Next, when I run &quot;valgrind --leak-check=full ./main&quot;, there are plenty of messages about &quot;possibly lost&quot; blocks.<br>
</div><br></div>When I replace &quot;vtkDataSetMapper&quot; by e.g. &quot;vtkIdList&quot;, valgrind has no complaints. When I replace &quot;vtkDataSetMapper&quot; by &quot;vtkRenderWindow&quot;, valgrind gives me similar error messages.<br>
<br></div><div>I have installed VTK 5.8.<br></div><div><br></div>What am I missing?<br><br><br></div>Regards,<br><br>Liesbeth Vanherpe<br></div>