<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>300614</bug_id>
          
          <creation_ts>2025-10-13 01:51:52 -0700</creation_ts>
          <short_desc>[GTK][WPE] Make ANGLE WebGL context not current before its destruction</short_desc>
          <delta_ts>2025-10-13 03:23:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=300085</see_also>
    
    <see_also>https://github.com/WebKit/WebKit/pull/52076</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Miguel Gomez">magomez</reporter>
          <assigned_to name="Miguel Gomez">magomez</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>ian.grunert</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2150468</commentid>
    <comment_count>0</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2025-10-13 01:51:52 -0700</bug_when>
    <thetext>On https://commits.webkit.org/301043@main I reordered the calls to make the WebGL ANGLE context not current and destroy it, so the destruction would happen before the context was removed as current. This was done to make the destruction work on some platforms, after checking that the destruction of the current context just marks the context for destruction, and the context is not really destroyed until it&apos;s removed from current.

But it seems that this the Windows port, and they had to add an exception to fix it in https://commits.webkit.org/301330@main.

After some more testing, I think that the reorder was a mistake and it should be undone, so I&apos;m creating a PR that will undo that. Also, this means that the workaround added for Windows should not be needed anymore, so I&apos;ll remove it as well, as the Windows problem should be fixed with this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2150482</commentid>
    <comment_count>1</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2025-10-13 02:54:26 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/52230</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2150486</commentid>
    <comment_count>2</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2025-10-13 03:23:11 -0700</bug_when>
    <thetext>I also realized that another problem with the Windows port was that their ANGLE sharingContext is a singleton, while for GTK/WPE it&apos;s not. So the sharingContext can&apos;t be destroyed for Windows. The PR sent is also taking that into account.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>