Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Bug #741: Problem with TVLandscape.Destroy
Product:
TV3D SDK 6.5
Language:
Not Specified
Current State:
Closed
Resolution:
Fixed
Created On:
August 12th, 2007
Last Modified:
August 16th, 2007
Reported By:
Sethergal
Description:
TrueVision 3D Engine (.NET) throws an AccessViolationException while closing a Windows Forms application after a TVLandscape.Destroy() method call.

Exception Message:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Stack Trace:
at CTVEngine.__dtor(CTVEngine* )
at MTV3D65.TVEngine.Finalize()

Loaded modules:
Order Name Path Optimized User Code Version
1 mscorlib.dll C:WINDOWSassemblyGAC_32mscorlib2.0.0.0__b77a5c561934e089mscorlib.dll Yes No 2.0.50727.832 (QFE.050727-8300)
2 Microsoft.VisualStudio.HostingProcess.Utilities.dll C:WINDOWSassemblyGAC_MSILMicrosoft.VisualStudio.HostingProcess.Utilities8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.HostingProcess.Utilities.dll Yes No 8.0.50727.42
3 System.Windows.Forms.dll C:WINDOWSassemblyGAC_MSILSystem.Windows.Forms2.0.0.0__b77a5c561934e089System.Windows.Forms.dll Yes No 2.0.50727.832 (QFE.050727-8300)
4 System.dll C:WINDOWSassemblyGAC_MSILSystem2.0.0.0__b77a5c561934e089System.dll Yes No 2.0.50727.832 (QFE.050727-8300)
5 System.Drawing.dll C:WINDOWSassemblyGAC_MSILSystem.Drawing2.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll Yes No 2.0.50727.832 (QFE.050727-8300)
6 Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll C:WINDOWSassemblyGAC_MSILMicrosoft.VisualStudio.HostingProcess.Utilities.Sync8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.HostingProcess.Utilities.Sync.dll Yes No 8.0.50727.42
7 WindowsApplication1.vshost.exe U:TestProjectsWindowsApplication1WindowsApplication1inDebugWindowsApplication1.vshost.exe Yes No 8.0.50727.42
8 System.Data.dll C:WINDOWSassemblyGAC_32System.Data2.0.0.0__b77a5c561934e089System.Data.dll Yes No 2.0.50727.832 (QFE.050727-8300)
9 System.Deployment.dll C:WINDOWSassemblyGAC_MSILSystem.Deployment2.0.0.0__b03f5f7f11d50a3aSystem.Deployment.dll Yes No 2.0.50727.832 (QFE.050727-8300)
10 System.Xml.dll C:WINDOWSassemblyGAC_MSILSystem.Xml2.0.0.0__b77a5c561934e089System.Xml.dll Yes No 2.0.50727.832 (QFE.050727-8300)
11 WindowsApplication1.exe U:TestProjectsWindowsApplication1WindowsApplication1inDebugWindowsApplication1.exe No Yes 1.0.0.0
12 MTV3D65.dll U:TestProjectsWindowsApplication1WindowsApplication1inDebugMTV3D65.dll No No
13 System.Configuration.dll C:WINDOWSassemblyGAC_MSILSystem.Configuration2.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll Yes No 2.0.50727.832 (QFE.050727-8300)


Isolated proof code:
private void Form1_Load(object sender, EventArgs e)
{
TVEngine engine = new TVEngine();
engine.SetBetaKey (...);
engine.SetLicenseKey(...);
engine.Init3DWindowed(Handle);

TVScene scene = new TVScene();
TVLandscape landscape = scene.CreateLandscape(null);
landscape.CreateEmptyTerrain(CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_ULTRA, 1, 1, 0.0f, 0.0f, 0.0f);
landscape.Destroy(); // when this line is removed, application shuts down properly
}

Reproduction steps:
Create a new Windows Forms Application, create an event handler for Form1.Load event, paste above code. Run the application and close it

Comments:

Posted by SylvainTV on August 16th, 2007 at 3:39 PM
Thanks, it was quite a severe bug actually !