/**
  * Terminate the message loop thread if there are no active (non-disposed) WebView instances. Has
  * no effect if there are active instances.
  */
 protected void stopMessageLoopIfNoInstances() {
   synchronized (webViewUILock) {
     if (instances.get() <= 0) {
       WindowsWebViewJNI.releaseMessageLoop(webViewMessageLoop);
       webViewMessageLoop = 0;
       webViewUI = null;
     }
   }
 }