<div dir="ltr">Hi,<div><br></div><div>I'm investigating the code, and for someone not familiar with it, it's very complex.</div><div><br></div><div>On com.sun.javafx.tk.quantum.WindowStage it will do this when changing scene:</div><div><div style="background-color:rgb(30,31,34);color:rgb(188,190,196)"><pre style="font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(207,142,109)">if </span>(oldScene != <span style="color:rgb(207,142,109)">null</span>) {<br>    ViewPainter painter = ((ViewScene)oldScene).getPainter();<br>    QuantumRenderer.<span style="font-style:italic">getInstance</span>().disposePresentable(painter.<span style="color:rgb(199,125,187)">presentable</span>);   <span style="color:rgb(122,126,133)">// latched on RT<br></span>}<br></pre></div></div><div>But not when closing the Sage (possible problem #1).</div><div><br></div><div>When changing scenes, ES2SwapChain dispose will be called:</div><div><br></div><div><div style="background-color:rgb(30,31,34);color:rgb(188,190,196)"><pre style="font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(207,142,109)">public void </span><span style="color:rgb(86,168,245)">dispose</span>() {<br>    <span style="color:rgb(207,142,109)">if </span>(<span style="color:rgb(199,125,187)">stableBackbuffer </span>!= <span style="color:rgb(207,142,109)">null</span>) {<br>        <span style="color:rgb(199,125,187)">stableBackbuffer</span>.dispose();<br>        <span style="color:rgb(199,125,187)">stableBackbuffer </span>= <span style="color:rgb(207,142,109)">null</span>;<br>    }<br>}<br></pre></div></div><div><br></div><div>But it does not dispose the  drawable that should clear the native struc <span style="font-family:"JetBrains Mono",monospace;font-size:9.8pt;background-color:rgb(30,31,34);color:rgb(188,190,196)">DrawableInfo</span> created, I think (possible problem #2).</div><div><br></div><div>Does it make sense?</div><div><br></div><div>-- Thiago.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 24 de set. de 2024 às 14:10, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I might be mistaken, but it seems <span style="font-family:"JetBrains Mono",monospace;font-size:9.8pt;background-color:rgb(30,31,34);color:rgb(188,190,196)">deleteDrawableInfo</span> is never called.<div><br></div><div>I think it should be called when the platform View is replaced or when the window is closed.</div><div><br></div><div><div>Github search for <span style="background-color:rgb(30,31,34);color:rgb(188,190,196);font-family:"JetBrains Mono",monospace;font-size:13.0667px">deleteDrawableInfo</span></div><div><a href="https://github.com/search?q=repo%3Aopenjdk%2Fjfx%20deleteDrawableInfo&type=code" target="_blank">https://github.com/search?q=repo%3Aopenjdk%2Fjfx%20deleteDrawableInfo&type=code</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 24 de set. de 2024 às 09:07, Thiago Milczarek Sayão <<a href="mailto:thiago.sayao@gmail.com" target="_blank">thiago.sayao@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><div><br></div><div>While doing some work on replacing GLX with EGL I discovered a possible leak.</div><div><br></div><div>Running this test:</div><div>gradle -PFULL_TEST=true -PUSE_ROBOT=true  :systemTests:test --tests SetSceneScalingTest<br></div><div><br></div><div>will result in X11GLDrawable -> nCreateDrawable to be called multiple times on the same test, while GLDrawable -> deleteDrawableInfo is never called, generating a leak (I think).</div><div><br></div><div>I can probably fix this, but I still have little knowledge on the es2 part, so any help would be appreciated.</div><div><br></div><div>-- Thiago.</div><div><br></div></div>
</blockquote></div>
</blockquote></div>