Hello Colleagues,<div><br></div><div>I&#39;ve built some logic around of vtkJPEGReader &amp; vtkPNGReader on C++ and wrapped them into C++/CLI to make accessible in a .NET 4.5 application. If the .NET application runs in a single thread - everything is fine. If I increment the number of threads to 2 or greater - the app fails on AccessViolationException. Everything also works well in a multi-threaded context of a sample x64 C++ application. I&#39;ve made some research and figured the application fails even if I don&#39;t call or use any VTK logic or classes except of just creating a vtkJPEGReader and use the CLI wrapped code in a managed multi-threaded context:</div>
<div><div><br></div><div>vtkJPEGReader::New()  or  vtkSmartPointer&lt;vtkJPEGReader&gt;::New() - both kill my stuff in a fraction of a second!</div></div><div><br></div><div>As I said I do not experience any problems or memory leaks running a sample unmanaged application, so I think this is related to how .NET manages threads and memory. Got tired of googling this issue, the only thing I&#39;ve found so far is this one: <a href="http://comments.gmane.org/gmane.comp.lib.vtk.user/54680">http://comments.gmane.org/gmane.comp.lib.vtk.user/54680</a> but not sure if it&#39;s related to my problem, and I&#39;d like to hear if somebody knows a solution or at least a hint...</div>
<div><br></div><div>Thanks in advance!</div><div>Oleg</div>