Files
ResInsight/ApplicationLibCode
Kristian Bendiksen 89e940b1ea Fix QProxyStyle memory leak in PdmUiTreeViewStyle creation
Address sanitizer detected a memory leak in QProxyStyle objects
created during GUI theme updates.

Problem: The updateGuiTheme() function was called multiple times (e.g., during
initialization) and repeatedly created new PdmUiTreeViewStyle objects for
every PdmUiTreeViewWidget without checking if the widget already had the
correct style set.

Root cause: Each call to updateGuiTheme() would:
1. Iterate through ALL widgets in the application
2. Create a new PdmUiTreeViewStyle for every tree view widget
3. Call setStyle() which should take ownership, but repeated calls
   were causing memory leaks

Fix: Added a check to only create and set a new PdmUiTreeViewStyle if the
widget doesn't already have one. This prevents repeatedly creating new
styles for the same widgets during multiple theme update calls.

The fix uses dynamic_cast to check if the current style is already a
PdmUiTreeViewStyle before creating a new one.
2025-09-04 09:04:30 +02:00
..
2025-08-28 20:14:53 +02:00
2025-09-03 14:21:19 +02:00
2024-07-01 14:09:56 +02:00