Skip to content

Commit

Permalink
Fixed use after free bug in generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
aborziak-ms committed Feb 15, 2024
1 parent 767465b commit 4d7558c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ void WriteEnsureImageLoadingStarted(CodeBuilder builder)
builder.WriteLine("if (!m_isImageLoadingStarted)");
builder.OpenScope();
builder.WriteLine("m_isImageLoadingStarted = true;");
builder.WriteLine($"TypedEventHandler<LoadedImageSurface, LoadedImageSourceLoadCompletedEventArgs> eventHandler{{ this, &{_sourceClassName}::HandleLoadCompleted }};");
builder.WriteLine($"TypedEventHandler<LoadedImageSurface, LoadedImageSourceLoadCompletedEventArgs> eventHandler{{ get_weak(), &{_sourceClassName}::HandleLoadCompleted }};");

foreach (var n in SourceInfo.LoadedImageSurfaces)
{
Expand Down

0 comments on commit 4d7558c

Please # to comment.