[vtkusers] 5.0 vtk crash with /MT build on windows

hu ning nickhuning at hotmail.com
Wed Nov 14 10:49:37 EST 2007


Hi,

I wonder if anyone here has experienced this kind of problem and could give me some advice: I have to build the vtk 5.0.3 shared libraries with /MT instead of /MD on VC++ 8, then every time when my application start initializing vtkRenderWindow it crashes. I am able to find in the class vtkOpenGLRenderWindow:
vtkOpenGLRenderWindow::vtkOpenGLRenderWindow()
{
        this->MultiSamples = vtkOpenGLRenderWindowGlobalMaximumNumberOfMultiSamples;
         this->TextureResourceIds = vtkIdList::New();
          if ( this->WindowName ) 
                delete [] this->WindowName; ########## crash here
          this->WindowName = new char[strlen("Visualization Toolkit - OpenGL")+1];
                strcpy( this->WindowName, "Visualization Toolkit - OpenGL" );
}

when it try to delete [] this->WindowName, there is memory corruption. I checked the content in the this->WindowName and it seems correct.

I also tested with the same vtk version with /MD build which is default setting, and it runs ok. The reason I need to have /MT because all the components in my app are built with /MT. The previous release of vtk, 4.2, doesn't have this problem.

Any discussion/advice will be highly appreciated!

Thank you,

Nick

_________________________________________________________________
Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for free today!
http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071114/4cd2cfd2/attachment.htm>


More information about the vtkusers mailing list