I'm having some problems cleaning up some of the processes my windows form application creates.
I'm using selenium which starts a process instance of a browser and a browser driver among other things.
Selenium library provides a Quit() method which if called inside my running application works just fine at cleaning up.
My problem is, that if my app is simply closed via the rex cross I cannot call Quit().
I have tried a number of things like creating a destructor for Form1 and calling Quit there, no luck. Tryed adding the following in Form1 class...
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
driver.Quit();
}
And that does not seem to work either.
Basically, it seems as though Quit() only works if I call it inside the public Form1() method.
Any suggestions on what I'm missing?
Thank you for reading.