<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [win] Heap corruption when closing webView not associated with a window"
   href="https://bugs.webkit.org/show_bug.cgi?id=151162#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [win] Heap corruption when closing webView not associated with a window"
   href="https://bugs.webkit.org/show_bug.cgi?id=151162">bug 151162</a>
              from <span class="vcard"><a class="email" href="mailto:isaac+webkit&#64;devinesystems.co.nz" title="isaac+webkit&#64;devinesystems.co.nz">isaac+webkit&#64;devinesystems.co.nz</a>
</span></b>
        <pre>This also affects minibrowser in the tests directory. (run it, attach debugger and close the minibrowser window).

I.e. it affects *all webviews*, including those attached to host windows.

Turns out the assertion is thrown when m_mutex is destroyed in Hashtable.h (line 493).
The Lock pointer held by the unique_ptr is bad, as shown by the following stack trace:

<span class="quote">&gt;        ucrtbased.dll!free_dbg_nolock(void * const block, const int block_use) Line 892        C++</span >
     ucrtbased.dll!_free_dbg(void * block, int block_use) Line 1011    C++
     WebKit.dll!operator delete(void * block) Line 17    C++
     WebKit.dll!operator delete(void * block, unsigned int __formal) Line 15    C++
     WebKit.dll!std::default_delete&lt;WTF::Lock&gt;::operator()(WTF::Lock * _Ptr) Line 1201    C++
     WebKit.dll!std::unique_ptr&lt;WTF::Lock,std::default_delete&lt;WTF::Lock&gt; &gt;::~unique_ptr&lt;WTF::Lock,std::default_delete&lt;WTF::Lock&gt; &gt;() Line 1404    C++
     WebKit.dll!WTF::HashTable&lt;WTF::String,WTF::KeyValuePair&lt;WTF::String,Inspector::SupplementalBackendDispatcher *&gt;,WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;WTF::String,Inspector::SupplementalBackendDispatcher *&gt; &gt;,WTF::StringHash,WTF::HashMap&lt;WTF::String,Inspector::SupplementalBackendDispatcher *,WTF::StringHash,WTF::HashTraits&lt;WTF::String&gt;,WTF::HashTraits&lt;Inspector::SupplementalBackendDispatcher *&gt; &gt;::KeyValuePairTraits,WTF::HashTraits&lt;WTF::String&gt; &gt;::~HashTable&lt;WTF::String,WTF::KeyValuePair&lt;WTF::String,Inspector::SupplementalBackendDispatcher *&gt;,WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;WTF::String,Inspector::SupplementalBackendDispatcher *&gt; &gt;,WTF::StringHash,WTF::HashMap&lt;WTF::String,Inspector::SupplementalBackendDispatcher *,WTF::StringHash,WTF::HashTraits&lt;WTF::String&gt;,WTF::HashTraits&lt;Inspector::SupplementalBackendDispatcher *&gt; &gt;::KeyValuePairTraits,WTF::HashTraits&lt;WTF::String&
     [External Code]    
     WebKit.dll!WTF::RefCounted&lt;Inspector::BackendDispatcher&gt;::deref() Line 146    C++
     WebKit.dll!WTF::Ref&lt;Inspector::BackendDispatcher&gt;::~Ref&lt;Inspector::BackendDispatcher&gt;() Line 57    C++
     WebKit.dll!WebCore::InspectorController::~InspectorController() Line 190    C++
     [External Code]    
     WebKit.dll!WebCore::Page::~Page() Line 293    C++
     [External Code]    
     WebKit.dll!WebView::close() Line 769    C++
     webkitdebugheap.exe!WinMain(HINSTANCE__ * hinst, HINSTANCE__ * __formal, char * __formal, int nShowCmd) Line 214    C++
     [External Code]</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>