You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix multiple memory leaks in Region::process() function (#4284)
* Fix multiple memory leaks in Region::process() function
- Add proper cleanup for allocated QApplication object
- Add proper cleanup for allocated char** argv array
- Add proper cleanup for allocated int* argc pointer
- Ensure all return paths properly clean up allocated memory
- Prevents memory leaks when Region::process() is called
Fixes multiple memory leaks identified in codebase analysis.
* Apply clang-format to fix code style compliance
- Remove trailing whitespace
- Normalize line endings
- Ensure compliance with project's clang-format rules
Fixes CI test-clang-format workflow failure.
* Refactor cleanup logic in Region::process
Introduced a cleanup lambda to handle memory deallocation in Region::process, replacing repeated code with a single reusable function for better maintainability and readability.
* Format cleanup lambda for readability
Reformatted the cleanup lambda in Region::process for improved readability by expanding it to multiple lines.
* Refactor Region::process to use smart pointers
Replaces manual memory management with std::unique_ptr for temporary QApplication and argument variables. Removes redundant cleanup logic for improved safety and readability.
0 commit comments