As the title implies, when I close the window for the form, the program crashes and throws this exception.
An unhandled exception of type 'System.ObjectDisposedException' occurred in System.Windows.Forms.dll
Additional information: Cannot access a disposed object.
This the bit of code that includes the invoke.
public void Node2Data(float[] data, float deltaT)
{
if (InvokeRequired)
Invoke((Action)(() => Node2Data(data, deltaT))); // invoke itself
else
{
//send node 2 data to parent quat
parentQuat.X = data[0];
parentQuat.Y = data[1];
parentQuat.Z = data[2];
parentQuat.W = data[3];
This is part of a windows form program and should close the window and return to the start when it's all said and done.