<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, 14 Jan 2025 at 22:32, Chris Sherlock <<a href="mailto:chris.sherlock79@gmail.com">chris.sherlock79@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks, that is helpful but I still don’t understand why, when it is a scoped instance with RAII semantics, we need to run reset manually after we’ve finished using it.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">So in the case of</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"> commit 44dfcebde64b9edfa9f50eace34e5e1497ab9314<br> Author: Michael Weghorn <<a href="mailto:m.weghorn@posteo.de">m.weghorn@posteo.de</a>><br> Date: Tue Jan 14 05:59:31 2025 +0100<br> Revert "vcl: remove unnecessary resets"</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">The problem is this line of code after the reset() calls:</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"> m_aLastResult = BitmapEx(aContent, aAlpha);</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">And that line of code will assert if there are any currently active BitmapWriteAccess objects.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">So the BitmapWriteAccess objects have to be cleared/reset before the copy can happen.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br> <br></div></div></div>