rickomax / psxprev

PSXPREV - Playstation (PSX) Files Previewer/Extractor
BSD 2-Clause "Simplified" License
200 stars 10 forks source link

Cleanup disposable resources on failure to parse #76

Closed trigger-segfault closed 1 year ago

trigger-segfault commented 1 year ago

Currently, when parsing a file fails, an exception is thrown and nothing is done after that besides continuing to the next offset. However, certain classes may have been created that need to properly be disposed of, namely textures and their Bitmap class.

I've also noticed that Graphics is not disposed of after drawing to VRAM. I'm not familiar with whether that needs to be disposed or not, but it's another thing to consider.

trigger-segfault commented 1 year ago

This has been partially implemented by PR #77. Cleanup on parse failure still needs to be handled.