title: Firefox via GeckoDriver throws exception on .Quit() in Selenium 3.0.1
body: <p>Context: Firefox 50.0.2 64bit, C#, Visual Studio 2015, Windows Server 2012 R2, Azure, ClearScript.V8.5.4.7, Selenium.Mozilla.Firefox.Webdriver.0.6.0.1, Selenium.WebDriver.GeckoDriver.Win64.0.11.1</p>
  
  <p>I'm using ClearScript to wrap the Selenium objects for use in JavaScript, viz</p>
  
  <pre><code>    static JScriptEngine JSengine = null;
      ...
      JSengine = new JScriptEngine(WindowsScriptEngineFlags.EnableDebugging | WindowsScriptEngineFlags.EnableJITDebugging);
      ...
      JSengine.AddHostType("CSFirefoxDriver", typeof(FirefoxDriver));
      JSengine.AddHostType("CSFirefoxOptions", typeof(FirefoxOptions));
      JSengine.AddHostType("CSFirefoxDriverService", typeof(FirefoxDriverService));
  </code></pre>
  
  <p>I instantiate Firefox using the following JS </p>
  
  <pre><code>var driverService = CSFirefoxDriverService.CreateDefaultService();
  driverService.FirefoxBinaryPath = "C:\\Program Files\\Mozilla Firefox\\firefox.exe";
  driverService.HideCommandPromptWindow = true;
  driverService.SuppressInitialDiagnosticInformation = true;
  var options = new CSFirefoxOptions();
  driver = new CSFirefoxDriver(driverService, options, CSTimeSpan.FromSeconds(30));
  </code></pre>
  
  <p>The matching Quit/Dispose code is </p>
  
  <pre><code>try {
    driver.Quit();
  } catch (E) {
    T.Error().Send("driver.Quit() failed.");
  }
  
  try {
    driver.Dispose();
  } catch (E) {
    T.Error().Send("driver.Dispose() failed.");
  }
  </code></pre>
  
  <p>(T is a logging object)</p>
  
  <p>When the .Quit() method call is executed, I get the following dialog. </p>
  
  <p><a href="https://i.stack.imgur.com/wIKRS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wIKRS.png" alt="Demonstration of crash"></a></p>
  
  <p>If I comment out the the .Quit() then I get the same on the .Dispose().</p>
  
  <p>Other forums have suggested turning off hardware acceleration in Firefox's preferences. This has not made any difference at all. </p>
  
  <p>There is also an issue on the <a href="https://github.com/mozilla/geckodriver/issues/210" rel="noreferrer">geckodriver</a> forum about this claiming a fix of some sort. It's certainly not fixed now.</p>
  
  <p>Windows Event Log isn't particularly helpful here, viz</p>
  
  <pre><code>&lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
      &lt;System&gt;
          &lt;Provider Name="Application Popup" Guid="{47BFA2B7-BD54-4FAC-B70B-29021084CA8F}" /&gt; 
          &lt;EventID&gt;26&lt;/EventID&gt; 
          &lt;Version&gt;0&lt;/Version&gt; 
          &lt;Level&gt;4&lt;/Level&gt; 
          &lt;Task&gt;0&lt;/Task&gt; 
          &lt;Opcode&gt;0&lt;/Opcode&gt; 
          &lt;Keywords&gt;0x8000000000000000&lt;/Keywords&gt; 
          &lt;TimeCreated SystemTime="2016-12-13T03:16:28.936810900Z" /&gt; 
          &lt;EventRecordID&gt;1227958&lt;/EventRecordID&gt; 
          &lt;Correlation /&gt; 
          &lt;Execution ProcessID="5856" ThreadID="11580" /&gt; 
          &lt;Channel&gt;System&lt;/Channel&gt; 
          &lt;Computer&gt;VM1-SQLWEB-W12&lt;/Computer&gt; 
          &lt;Security UserID="S-1-5-18" /&gt; 
      &lt;/System&gt;
      &lt;EventData&gt;
          &lt;Data Name="Caption"&gt;firefox.exe - Application Error&lt;/Data&gt; 
          &lt;Data Name="Message"&gt;The exception Breakpoint A breakpoint has been reached. (0x80000003) occurred in the application at location 0x880f00ef. Click on OK to terminate the program Click on CANCEL to debug the program&lt;/Data&gt; 
      &lt;/EventData&gt;
  &lt;/Event&gt;
  </code></pre>
  
  <p>Where do I go from here? I can fall back to PhantomJS until a fix is found.</p>