<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Thread leak when changing context size"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107092#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Thread leak when changing context size"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107092">bug 107092</a>
              from <span class="vcard"><a class="email" href="mailto:sroland@vmware.com" title="Roland Scheidegger <sroland@vmware.com>"> <span class="fn">Roland Scheidegger</span></a>
</span></b>
        <pre>I'm near certain this is a bug in the xlib state tracker rather than llvmpipe.
swr will leak as well, you just don't notice because it doesn't create
additional threads.
glXChooseFBConfig will call choose_visual(), which will call xmesa_init(),
which will create the pipe screen (via xmesa_init_display()). (llvmpipe threads
are per screen, not per context.)
(mesa/src/gallium/state_trackers/glx/xlib/ xm_api.c and glx_api.c)

Note that there's 2 places where the screens would get destroyed (one in
xmesa_close_display(), reached via XCloseDisplay(), the other is in
XMesaDestroyContext(), reached via glXDestroyContext()). Both are commented out
and marked as FIXME, since apparently it's not safe to destroy the screen at
this point since surfaces can still be around...
This looks apparently broken but it's not obvious to me how to fix it. At first
glance it looks like screen destruction should be delayed until there's neither
contexts nor surfaces referencing it are around but I guess it isn't that
easy...</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>