Files
ResInsight/ApplicationLibCode/UserInterface
Kristian Bendiksen 0cce2bb42d Fix critical RiuContextMenuLauncher memory leak by setting parent widget
Address sanitizer detected a memory leak in CmdFeatureMenuBuilder::MenuItem
objects caused by RiuContextMenuLauncher objects that were never deleted.

Problem: The RiuContextMenuLauncher class has two constructors:
1. RiuContextMenuLauncher(widget, CmdFeatureMenuBuilder&) - sets parent ✓
2. RiuContextMenuLauncher(widget, QStringList&) - missing parent ✗

The second constructor was missing the parent initialization, causing all
RiuContextMenuLauncher objects created with QStringList (used in 10+ locations)
to never be deleted, leading to memory leaks of their internal MenuItem vectors.

Root cause: Missing parent-child relationship meant Qt couldn't automatically
clean up these objects when their associated widgets were destroyed.

Fix: Added `: QObject( widget )` to the second constructor to match the first
constructor's behavior. This ensures Qt's automatic parent-child cleanup
handles the RiuContextMenuLauncher lifecycle properly.

This fixes the systemic issue affecting multiple plot types including:
- Correlation plots, Analysis plots, VFP plots, Well allocation plots
- All locations using `new RiuContextMenuLauncher(widget, {commands})`
2025-09-04 09:04:30 +02:00
..
2021-04-15 08:00:07 +02:00
2023-10-03 09:04:08 +02:00
2023-04-14 14:07:45 +02:00
2025-01-28 11:20:32 +01:00
2025-03-14 14:03:09 +01:00
2022-10-31 13:26:26 +01:00
2022-10-31 13:26:26 +01:00
2022-11-25 08:59:10 +01:00
2024-09-16 09:49:22 +02:00
2024-03-07 19:45:43 +01:00
2025-02-25 14:58:33 +01:00
2025-02-25 14:58:33 +01:00
2022-07-07 12:03:02 +02:00
2025-02-25 14:58:33 +01:00
2025-02-25 14:58:33 +01:00
2021-04-15 08:00:07 +02:00
2022-11-01 08:00:51 +01:00
2023-09-15 13:59:58 +02:00
2022-07-07 12:03:02 +02:00
2025-02-25 14:58:33 +01:00
2025-08-27 14:22:11 +02:00
2025-04-11 18:34:32 +02:00
2025-03-14 14:03:09 +01:00
2024-10-28 13:09:18 +01:00
2024-09-16 09:49:22 +02:00
2024-09-16 09:49:22 +02:00
2024-09-02 13:58:00 +02:00
2024-09-02 13:58:00 +02:00