This allows us make the storing of metadata more efficient, and also allows us
to use custom _to_string() functions for the types.
NOTE: We have to be a bit careful when creating GsApp objects in modules outside
of the plugin -- for instance GsAppstream.c needs to use gs_plugin_app_new()
rather than gs_app_new() so the correct type gets used. Simlarly, plugins need
to implement gs_plugin_create_app() if they are defining a custom GType.
It’s already stored within the `GtkWidget` with a strong reference.
Nothing else refers to `GnomeSoftware::provider`, so we can safely drop
this.
Signed-off-by: Philip Withnall <email address hidden>
fed85f0...
by
Philip Withnall <email address hidden>
gs-common: Require a CSS class name for custom CSS
Rather than building one out of the pointer to the widget name, require
a hard-coded one. CSS class names are interned into the global `GQuark`
table by GTK, so constructing a different one for each widget means that
table grows without bound. That is bad — all those strings are
(deliberately) leaked, and every addition slows the quark table down a
bit.
In order to allow the same class name to be reused across multiple
widgets without interfering, install the custom `GtkCssProvider` only on
the given widget instance, rather than for the entire screen.
Signed-off-by: Philip Withnall <email address hidden>
a014b3d...
by
Philip Withnall <email address hidden>
flatpak: Ensure use of the installed_refs cache is thread-safe
Just like the `broken_remotes` cache, the `installed_refs` cache is
shared between multiple threads. Previously, there was no mutex
protecting access to it, so one thread could replace it while another
was using it. Or, more typically (which is how I spotted this), two
threads would race to call `flatpak_installation_list_installed_refs()`
to populate it; one would win, and the other thread’s value would be
leaked.
This was resulting in 80KB of leaks after a few minutes of using
gnome-software.
Signed-off-by: Philip Withnall <email address hidden>
d35f942...
by
Philip Withnall <email address hidden>
gs-details-page: Fix a minor leak in a comparison function
Signed-off-by: Philip Withnall <email address hidden>