You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 via BitmapRegistry.Instance.TryGetBitmapId(), the bitmap is found in lookup, 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:
I found even more problems, which brought me to the conclusion, not to use Unregister(). If we want to use it, we need a counter system, set track, how often a bitmap is used and if it is the last unregister call, remove it.
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.
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: