Kruptein / PlanarAlly

A companion tool for when you travel into the planes.
https://www.planarally.io/
MIT License
392 stars 71 forks source link

feat(Asset): Improve asset disk removal conditions #1303

Closed Kruptein closed 11 months ago

Kruptein commented 11 months ago

When removing an asset from the asset manager a check is done to see if the actual image that is stored on disk has to be removed.

This check only looked at whether any other asset was still using the image. This could result in the issue where you drop an asset in a campaign, then remove the asset and the shape can no longer be rendered because the disk-image was removed as part of the asset removal procedure.

This PR fixes this, by also checking if any shapes are still depending on the image before removing it. Additionally when removing a shape with an image, the same cleanup check is also run now.