waybar/src/modules/sni
André Aparício a1cd0acac5 Fix random segfault on GTK icon functions
The segfaults were happening on GTK icon theme functions, which are
called via the C++ interface functions such as Gtk::IconTheme::has_icon.

There are multiple modules and threads using this functions on the default
icon theme by calling Gtk::IconTheme::get_default(), which returns the same
object for all callers, and was causing concurrent access to the same internal
data structures on the GTK lib. Even a seemingly read-only function such as
has_icon can cause writes due to the internal icon cache being updated.

To avoid this issues, a program wide global mutex must be used to ensure
a single thread is accessing the default icon theme instance.

This commit implements wrappers for the existing IconTheme function calls,
ensuring the global lock is held while calling the underling GTK functions.
2023-07-03 22:32:24 +01:00
..
host.cpp Tray module cause error g_bus_unwatch_name() 2023-06-06 23:02:36 +03:00
item.cpp Fix random segfault on GTK icon functions 2023-07-03 22:32:24 +01:00
tray.cpp refactor: remove warning 2022-12-01 08:45:12 +01:00
watcher.cpp Happy Linter 2023-06-06 23:06:11 +03:00