Hi,
First off I’m using DirectX version and running 3.6.
When I call the Exit() command my game closes fine, no problems what so ever.
However if I close it using the “x” on the game window when running in windowed mode the game crashes at the following lines
  _secondryVertexDataIndex.Clear();
                    _secondryVertexDataIndex.AddRange(tmpindex);
                    _secondVertexBuffer = new VertexBuffer(Engine.graphicsDevice, VertexPositionColourNormalTexture.VertexDeclaration, vertextcounter,
                        BufferUsage.WriteOnly);
                    _secondVertexBuffer.SetData(verts.ToArray());
                    _secondVertexCount = vertextcounter / 3;
its the _secondVertexBuffer = new VertexBuffer line that it crashes at. It has a NullReferenceException.
My first though was that the graphicDevice was Null or vertextcounter had an invalid value but this is not the case.
Any help would be appreciated.