-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BitmapRegistry.Unregister() doesn't remove bitmap from lookup array #2386
Comments
I found even more problems, which brought me to the conclusion, not to use |
Perhaps a first step is to remove Unregister(). What was the reason you used it? (to get an impression of the use case). A general thing we need to work on is to get an overview of all caching we are using in Mapsui. Over the years we added many caches in different places. It should at least be possible to disable caching. This should affect performance and not functionality. In some cases this is not possible. This means it is not a cache but in in-memory datastore, and we need to think about it in a different way. |
I used it when working on the markers. You could create pins with whatever color you want. This is done with string replacement of the original color and then the SVG is registered. But if you replace this bitmap entry with a new one (change color), a new bitmap is added. So I thought, it would be a good idea to remove the old one. But I thought not about what happen, if two pins have the same color and only one get a new color. So, yes, I have to think about this. |
Mapsui Version
All
Mapsui Platform
All
Device
All
Describe the bug
If you remove a bitmap with
BitmapRegistry.Instance.Unregister()
it is deleted from array_register
but not from_lookup
. If you now try to get a bitmap viaBitmapRegistry.Instance.TryGetBitmapId()
, the bitmap is found inlookup
, but isn't longer in_register
.Expected behavior
BitmapId should also deleted in
lookup
array.The text was updated successfully, but these errors were encountered: