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.
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.