Home Forums Legacy SDKs Tear Down protocol Reply To: Tear Down protocol

#1613
Robert [Tobii]
Participant

Hi,

Thank you for reporting this bug. You are right, the tear-down in the WinFormsSample is not correct.

I added an OnClosing event handler to dispose the eye tracker and avoid the crash:

        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            base.OnClosing(e);

            _eyeTrackingEngine.Dispose();
        }