<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash using "Close" button for Extension Manager -> Check for Updates dialog"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=115420#c39">Comment # 39</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash using "Close" button for Extension Manager -> Check for Updates dialog"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=115420">bug 115420</a>
              from <span class="vcard"><a class="email" href="mailto:michael.meeks@collabora.com" title="Michael Meeks <michael.meeks@collabora.com>"> <span class="fn">Michael Meeks</span></a>
</span></b>
        <pre>Hmm - then again ... looking at the code:

vcl/win/window/salframe.cxx

It puzzles me:

WinSalFrame::~WinSalFrame()
{

    // Release Cache DC
    if ( mpGraphics2 &&
         mpGraphics2->getHDC() )
        ReleaseGraphics( mpGraphics2 );

Doesn't seem to do anything of the sort; unless mpGraphics2 == mpGraphics.

Indeed the condition:

void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
{
    if ( mpGraphics2 == pGraphics )
    {

Looks deeply counter-intuitive; surely that should be mpGraphics2 != pGraphics
- ie. only free it if it is different ?

I'm left puzzled by who frees mpGraphics2 - which (after all) has this timer
associated with it. Of course, that is not related to GL, and perhaps is a leak
but only when used threaded:

    WinSalGraphics*         mpGraphics;             // current frame graphics
    WinSalGraphics*         mpGraphics2;            // current frame graphics
for other threads

The rather grim extensions code being high on the awful threaded, graphical
code list of horror.

Thoughts much appreciated; I append a blind fix in case someone can reproduce
this and can compile that.

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 64b073f99139..fee8440cc700 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -926,6 +926,17 @@ WinSalFrame::~WinSalFrame()
          mpGraphics2->getHDC() )
         ReleaseGraphics( mpGraphics2 );

+    // Why did we never do this ?
+    if (mpGraphics2 != mpGraphics)
+    {
+        if ( mpGraphics2->getDefPal() )
+            SelectPalette( mpGraphics2->getHDC(), mpGraphics2->getDefPal(),
TRUE );
+        mpGraphics2->DeInitGraphics();
+        ReleaseDC( mhWnd, mpGraphics2->getHDC() );
+        delete mpGraphics2;
+        mpGraphics2 = nullptr;
+    }
+
     // destroy saved DC
     if ( mpGraphics )
     {

But quite possibly I'm confused =) it happens.</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>