Skip to content

Commit

Permalink
Fix loading WPF BitmapImage from a network stream (#793)
Browse files Browse the repository at this point in the history
* Do not freeze `BitmapImage` if it cannot be frozen (#792)

* Remove whitespace

Co-authored-by: Glenn <5834289+glennawatson@users.noreply.github.com>
Co-authored-by: David Vreony <dpvreony@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 21, 2021
1 parent a8efa69 commit 24009a9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ private static void WithInit(BitmapImage source, Action<BitmapImage> block)
source.BeginInit();
block(source);
source.EndInit();
source.Freeze();

if (source.CanFreeze)
{
source.Freeze();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ private static void WithInit(BitmapImage source, Action<BitmapImage> block)
source.BeginInit();
block(source);
source.EndInit();
source.Freeze();

if (source.CanFreeze)
{
source.Freeze();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ private static void WithInit(BitmapImage source, Action<BitmapImage> block)
source.BeginInit();
block(source);
source.EndInit();
source.Freeze();

if (source.CanFreeze)
{
source.Freeze();
}
}
}
}

0 comments on commit 24009a9

Please sign in to comment.