[Insight-users] Global smartpointers.

dominique at toepfer-web.de dominique at toepfer-web.de
Thu Jul 21 10:51:48 EDT 2011


Hi everyone,

I have a question concerning global smartpointers. 

When porting some code that still used VTK 4.x to VTK 5.6.1, our application crashed on exit. We found some global vtk objects (now using smartpointers) to be responsible for that.

It does not seem to be a bug in our code: I took the cone example form http://www.vtk.org/Wiki/VTK/Examples/Cxx and made all smartpointers global. The application still works as expected but crashes on exit. 

Of course, we can avoid global smartpointers in our application, but now we are curious about the explanation of this behavior. Can anybody explain this?

I attached the code and the call stack. We used Visual C++ 2008.

Thanks in advance!
Dominique
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: application/octet-stream
Size: 1459 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110721/b7aaaaba/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeLists.txt
Type: application/octet-stream
Size: 181 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110721/b7aaaaba/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CallStack.txt
Type: application/octet-stream
Size: 7671 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110721/b7aaaaba/attachment-0002.obj>


More information about the Insight-users mailing list