Viktar Lukashonak
5c979152de
refactor(cava): fix thread-safety, resource leaks, and style violations
Comprehensive refactor of the cava module backend and frontends.
Style & naming
- Rename Cava -> CavaRaw; snake_case methods -> lowerCamelCase
- Replace NULL with nullptr; replace C-style casts with static_cast
- Add explicit standard-library includes (<memory>, <string>, <chrono>)
- Fix missing trailing underscores on member variables
Architecture
- Remove Gtk::GLArea multiple inheritance in CavaGLSL (composition)
- Return std::unique_ptr from factory; add doAction() to GLSL variant
- Encapsulate thread timing arithmetic in AdaptiveDelay struct
Thread safety & correctness
- Replace raw sigc::signal with SafeSignal for cross-thread marshalling
- Fix data race between loadConfig() and out_thread_ (recursive_mutex)
- Fix audio_raw shallow-copy use-after-free via deep-copy AudioRaw payload
- Make loadConfig() exception-safe with CavaConfigGuard RAII
- Fix blocking read_thread_ race on shutdown (condition_variable + timeout join)
- Fix isSilent() data race (acquire pthread mutex)
- Eliminate doUpdate() recursion (iteration instead)
- Guard audio_raw_clean() against uninitialized state
- Fix format-icons underflow and cava_config buffer overflow
- Store config by value to prevent dangling references on reload
- Cache frontend config and refresh on runtime changes
- Fix signed-char icon lookup bug on x86
- Prevent Json::Value mutation bloat via const-ref lookups
- Broaden exception catches in worker threads (std::exception)
Resource management & GL robustness
- Fix OpenGL resource leaks (persist VBO/IBO/VAO; explicit destructor cleanup)
- Fix shader error handling crashes (valid infoLog allocation)
- Cache uniform locations instead of querying per frame
- Fix gradient color uninitialized stack memory (zero-init + clamped count)
- Fix shader time uniform integer division bug (float arithmetic)
- Add explicit VAO bind in onRender()
- Handle runtime surface config changes independently of shader changes
- Clamp negative gradient_count before GL upload
Follow-up
- Singleton API split (inst() + configure()) intentionally deferred to a
dedicated PR because it changes the public constructor contract.
2026-07-13 19:50:09 +03:00
..
2026-07-13 19:50:09 +03:00
2026-07-03 23:42:17 +02:00
2026-02-04 09:24:14 +01:00
2026-07-05 23:06:37 +02:00
2026-07-05 10:13:24 +02:00
2026-07-03 23:51:40 +02:00
2026-03-30 14:25:41 -07:00
2026-07-05 00:29:27 -05:00
2026-07-04 01:42:35 +02:00
2026-07-05 23:06:37 +02:00
2026-07-05 10:13:24 +02:00
2026-07-04 13:43:01 +02:00
2026-03-02 08:21:20 -06:00
2026-07-05 10:23:06 -05:00
2023-10-15 17:52:12 -03:00
2026-02-04 09:24:14 +01:00
2026-07-03 22:11:06 +02:00
2026-07-03 23:51:45 +02:00
2023-10-24 20:16:50 +02:00
2026-07-04 00:37:39 +02:00
2023-09-13 21:56:35 +02:00
2026-07-03 23:52:02 +02:00
2023-10-17 19:29:06 +02:00
2024-02-19 23:10:10 +01:00
2026-04-08 23:36:47 +02:00
2026-07-04 08:41:35 -05:00
2026-07-03 22:39:52 +02:00
2026-03-19 17:39:57 -07:00
2025-06-22 10:01:36 +02:00
2026-07-04 02:14:13 +02:00
2026-07-05 10:20:41 +02:00
2023-03-02 16:57:32 +03:00
2026-02-04 09:24:14 +01:00
2026-02-24 19:21:13 +05:30
2023-10-17 19:29:06 +02:00
2026-05-28 23:56:52 +03:00
2026-07-04 13:43:01 +02:00
2026-07-03 22:11:51 +02:00
2026-07-03 22:01:20 +02:00
2026-07-03 22:29:33 +02:00
2023-03-02 16:57:32 +03:00
2026-02-04 09:24:14 +01:00
2026-03-17 21:35:20 +00:00
2026-07-03 18:44:03 +02:00
2026-02-04 09:24:14 +01:00
2023-03-02 16:57:32 +03:00
2026-07-05 09:53:11 +02:00
2026-07-04 01:36:46 +02:00