Address sanitizer detected a 1056-byte memory leak in QWidgetItem objects.
This was the actual root cause of the leak reported in the stack trace.
Problem: In ensureWidgetContainsEmptyGridLayout(), when clearing existing
layouts, the code was calling layout->takeAt(0) to remove QLayoutItem
objects but never deleting them. This caused QWidgetItem objects to
accumulate in memory without ever being freed.
The takeAt() method removes items from the layout but does NOT delete them.
The caller is responsible for deleting the returned QLayoutItem objects.
Fix: Added `delete item;` in the cleanup loop to properly free QWidgetItem
objects when clearing layouts before rebuilding the UI.
Address sanitizer detected a 1056-byte memory leak in QWidgetItem objects
created when adding widgets to layouts via QGridLayout::addWidget().
Root cause: PdmUiFieldEditorHandle destructor was using deleteLater() to
destroy widgets, but deleteLater() requires an active event loop to process
the delayed deletions. During application shutdown or certain cleanup
scenarios, the event loop may not process these deletions, causing
QWidgetItem objects to remain allocated.
Changes:
- Replace deleteLater() with immediate delete in destructor
- Update comment to explain why immediate deletion is necessary
- This ensures widgets and their associated QWidgetItem objects are
properly cleaned up when field editors are destroyed
The original comment acknowledged that deleteLater() "will not work unless
you are actually inside an event loop" - this change addresses that issue
by using direct deletion instead.
Address sanitizer detected a 32-byte memory leak in QVBoxLayout objects
created by PdmUiFormLayoutObjectEditor::recursivelyConfigureAndUpdateUiOrderingInGridLayout().
Root cause: QVBoxLayout objects were being both:
1. Added to parent layouts via addLayout() (proper Qt ownership)
2. Stored in m_layouts member vector (redundant storage)
The redundant storage prevented Qt's automatic cleanup, causing memory leaks.
Refactored RigGridBase::cellCornerVertices to return std::array<cvf::Vec3d, 8> by value instead of taking a reference to std::array as an output parameter. This change improves code readability and leverages modern C++ return value optimizations.
Updated all call sites across the codebase to reflect the new function signature.
This makes it possible to configure the capabilities of a field one place and avoids duplication.
Extends scripting capabilities by introducing a `dataType` method to `PdmAbstractFieldScriptingCapability`.
This allows the Python generator to retrieve the data type of a field directly from its scriptability, providing a more flexible and extensible way to determine the data type for scripting purposes.
Updates field reading to allow for data migration during the XML parsing process.
This change introduces a `migrateFieldContent` virtual method to `PdmObjectHandle`, allowing derived classes to modify field content before it's applied to the field.
The `PdmFieldReader` is refactored to leverage this method when available.
The specialized QString reader is merged into the generic reader.
Ensures that empty strings are correctly handled as `None` values when they are used as default values in optional fields of PDM objects. Avoid changes in other generated Python code introduced in
871973d02a
Ensures thread-safe initialization of PDM objects when created in parallel.
Avoids a potential race condition during the first instantiation of a PDM object in a multi-threaded environment. This is achieved by creating a dummy object in the main thread to trigger the necessary initialization before parallel creation begins.
Adds a unit test to verify the fix.
Adds a map to store field keywords, enabling faster field retrieval.
This optimization reduces the time complexity of `findField` from linear to near-constant time, improving overall performance when searching for fields by keyword.
Hiding an editor triggers field changed, and can cause updates that requires editors to be live. Delete editors in a separate loop after all editors are set hidden.
Trigger a hide event the editor to allow it to clean up. This is required to persist the changes in the editor when changing to a different dock widget.
* Do not create ensemble in initAfterRead
* Check if filter is active before update
* Do not recompute statistics on every loadData
* Removes unnecessary resampling
* MSVC: Add support for dynamic deoptimalization
* Make sure RFT plots are initialized based on curves in project file
* Make sure the progress dialog is always on top
* Add more progress info when loading project file
* Make sure names in RFT plots are updated
Do not create option items if the list is empty and the field contains a selection. This is different to other editors, but can cause a crash situation.
* Use vector name as axis object text, avoid identifier text
* Select the plot clicked at in the Project Tree
* Make sure RFT plots are updated when summary case and ensemble is changed
* Make sure all plots are updated for multiselect and toggle statistics
* Allow paste of plot on top level plot collection
* Allow multiple top level plots as destination for Append operations
* Improve python code generation tests
* Add setValveLocations
* Move code into RimFishbonesDefines
* Add scripting to fishbones
* Add scripting methods for fishbones
* Add example and test
We can have large collections of object, and the delete of these objects can be time consuming. To improve the user experience, the delete of these objects is delegated to `PdmChildArrayField<DataType*>::deleteChildrenAsync()`. When an object is deleted, it will disconnect signals from observers.
When the owner object is deleted all connected signals is disconnected. If the owner object is deleted at the same time as the contained objects are deleted in a separate thread we will quite often have undefined behaviour. This undefined behaviour is reproducible in a unit test.
Make sure that all signals are disconnected before the delete operation.
Avoid pixel size for easier config across multiple environments
Set default font size for plots to 10 points
Use Small instead of XSmall for default font in plot
Remove pt postfix to indicate point size
* Remove debug output in the views function
* Add scripting support for Mat4d
* Add scripting support to camera
* Separate updates for background color and font size
* Remove obsolete base class
* Add conversion between one/zero-based IJK
* Move code to RiaTextStringTools
* Add automatic update of grid cell curves when clicking in 3D view
* Fix missing conversion to QString
Add a static map between field keyword and a subset of enum values to be displayed in the GUI
If a subset is defined, automatically calculate value options for this subset, otherwise, use all enums
Improve the macro so it is possible to use the `EnumType` instead of `AppEnum<EnumType>` when defining the default value
* Enable time step selections and controls in view
* Support loading just what we need for statistics contour maps by using custom reader settings
* Close case once done with it unless there are active views.
* Add selection of user interface case (for result selection, display of wells, faults...)
* Avoid int overflow for nested progresses by using double
* Improve auto naming
* Misc. UI improvements
* #12044 Python: Add Non-Darcy properties available in Python
* #12049 Python: Add checking for multiple consecutive upper case letters
The scripting keyword is transformed to snake_case for use in Python. When data in Python is sent back to ResInsight, the opposite operation happens. This concept works well for most variants of keywords, but there are some corner cases that is not working.
Add compile time checking to make sure that the scripting keywords are formatted correctly.
Fix keyword that has been formatted the wrong way and has never worked.
* Avoid running test if ResInsight executable path is not defined in env
* Make sure dash is allowed in enumeration text string
When comparing two TextureImages, create a std::vector representation and use the equality operator for std::vector.
Previous implementation did not test all values, and returned equality when the texture was not identical.