Skip to content

Commit 6911064

Browse files
Copilotweiyuanyue
andauthored
Clarify pragma warning comment for outputBitmap ownership transfer (#552)
* Initial plan * Clarify pragma warning comment in MagicEraser The comment now correctly explains that outputBitmap's ownership is transferred to become the new _inputBitmap value, not to the old _inputBitmap. Co-authored-by: weiyuanyue <176483933+weiyuanyue@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: weiyuanyue <176483933+weiyuanyue@users.noreply.github.com>
1 parent 0e2494b commit 6911064

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AIDevGallery/Samples/WCRAPIs/MagicEraser.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private async void EraseObject_Click(object sender, RoutedEventArgs e)
190190

191191
try
192192
{
193-
// Ownership of outputBitmap is transferred to _inputBitmap, so it should not be disposed here
193+
// outputBitmap's ownership is transferred to become the new _inputBitmap, so it should not be disposed here
194194
#pragma warning disable IDISP001 // Dispose created
195195
var outputBitmap = _eraser.RemoveFromSoftwareBitmap(_inputBitmap, _maskBitmap);
196196
#pragma warning restore IDISP001

0 commit comments

Comments
 (0)