Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylyn-vex-dev] Why is StyleSheet using WeakReference for cached styles?

Hi,

I don't know the rational behind the weak references, but I think memory is not an issue for the stylesheets, and normally a stylesheet will not change at runtime (although we handle changes of the stylesheet files in Vex plug-ins at runtime, but a little extra work in this less common use case should be ok). So using hard references will make the style handling a lot easier and less error prone.

+1 for my side to replace the weak references with hard references.

Florian

Am 14.07.2013 12:37, schrieb Carsten Hiesserich:
Hi,

i'm playing with CSS properties and realized that the styles are
recalculated every time the layout is refreshed. There is a caching
mechanism for calculated styles, but this is using a WeakReference.
Since the styles are apparently not referenced elsewhere, the cached
styles are GC'ed every few seconds and have to be recalculated.

As long a i don't misunderstand the function of the cache (which is very
well possible) i think strong references should be used here, and the
styles should stay in the cache until StyleSheet#flushStyles is called.



_______________________________________________
mylyn-vex-dev mailing list
mylyn-vex-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-vex-dev



Back to the top