I'm still fairly new at this so I appologise in advance if I've missed something simple.
Anyway.
I have a window with 2 panels. 2 of which are displaying seperate 3D scenes. When trying to exit the program I am endeavouring to close the panels to release the resources. But it errors with an access violation on whichever panel I try to close last.
Whichever I close first is no problem., nor is disposing of the device subsequently. But the last panel is a real problem.
I assume this is becaue it is the last and therefore the window no longer has any valid objects? Maybe?
But because I can't dispose of the panel I can't get rid of the device or close the window.
I know I can leave it cause I'm exiting, but it seems so sloppy. Anyone have any ideas?
Me.SuspendLayout()
' CRASHES Here? Why??? Obviously the device is in use somehow? or something is not finished. What?
' Whichever two lines go first work! The other group crashes.
Me.PanelView.Dispose()
theDevice.Dispose()
' These lines don't work when escape is pressed.
Me.PanelMap.Dispose()
theMapDevice.Dispose()
' Yet if i don't take dispose of all the panels and the devices I can't close and dispose of the window either.
Me.Close()
Me.Dispose()
end sub
Thanks in advance.
Anyway.
I have a window with 2 panels. 2 of which are displaying seperate 3D scenes. When trying to exit the program I am endeavouring to close the panels to release the resources. But it errors with an access violation on whichever panel I try to close last.
Whichever I close first is no problem., nor is disposing of the device subsequently. But the last panel is a real problem.
I assume this is becaue it is the last and therefore the window no longer has any valid objects? Maybe?
But because I can't dispose of the panel I can't get rid of the device or close the window.
I know I can leave it cause I'm exiting, but it seems so sloppy. Anyone have any ideas?
Me.SuspendLayout()
' CRASHES Here? Why??? Obviously the device is in use somehow? or something is not finished. What?
' Whichever two lines go first work! The other group crashes.
Me.PanelView.Dispose()
theDevice.Dispose()
' These lines don't work when escape is pressed.
Me.PanelMap.Dispose()
theMapDevice.Dispose()
' Yet if i don't take dispose of all the panels and the devices I can't close and dispose of the window either.
Me.Close()
Me.Dispose()
end sub
Thanks in advance.