Stop throwing OutOfMemoryException for GDI+ errors in System.Drawing #12627
Labels
area-System.Drawing
System.Drawing issues
📖 documentation: breaking
A change in behavior that could be breaking for applications. Needs to be documented.
enhancement
Product code improvement that does NOT require public API changes/additions
Milestone
GDI+ returns
Status.OutOfMemory
for many general purpose errors. This is deeply confusing for users and almost never happens due to an actual lack of memory.I'm inclined to change this behavior to always throw
InvalidOperationException
with a message along the lines of:I can't know for sure that there isn't a low memory situation, but if it is other things are likely to fail imminently for lack of memory anyway.
I'd offer an
AppContext
opt-out switch that would throw with the old behavior.The text was updated successfully, but these errors were encountered: