I have a "recipe popup" where the user can can multiple instances. Every popup has a collection of images. Both recipes can have cut volumes of images. These images are rendered from svg. To reduce memory/cpu usage, I want to make a kind of "image cache" (static class with a collection of rendered svgs).
The Problem: If recipe1 has ImageA and ImageB, recipe2 has ImageB and ImageC, then only ImageA should be destroyed/disposed (removed from the collection) after recipe1 has closed.