Skip to content

Foundation classes - Leak of WinAPI resources#625

Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:CR415
Jul 18, 2025
Merged

Foundation classes - Leak of WinAPI resources#625
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
AtheneNoctuaPt:CR415

Conversation

@AtheneNoctuaPt
Copy link
Copy Markdown
Collaborator

Fix Image_AlienPixMap::Load to use smart pointer for IWICBitmapFlipRotator.

Fix Image_AlienPixMap::Load to use smart pointer for
IWICBitmapFlipRotator.
@AtheneNoctuaPt AtheneNoctuaPt added this to the Release 7.9.2 milestone Jul 18, 2025
@AtheneNoctuaPt AtheneNoctuaPt requested a review from dpasukhi July 18, 2025 14:15
@AtheneNoctuaPt AtheneNoctuaPt self-assigned this Jul 18, 2025
@AtheneNoctuaPt AtheneNoctuaPt added 2. Bug Something isn't working 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code labels Jul 18, 2025
@AtheneNoctuaPt AtheneNoctuaPt linked an issue Jul 18, 2025 that may be closed by this pull request
@dpasukhi dpasukhi requested a review from Copilot July 18, 2025 14:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a WinAPI resource leak in the Image_AlienPixMap::Load method by replacing raw pointer management with smart pointer management for IWICBitmapFlipRotator objects. This ensures proper automatic cleanup of COM objects and prevents potential memory leaks.

  • Replaces raw IWICBitmapFlipRotator pointer with Image_ComPtr smart pointer wrapper
  • Updates pointer access patterns to use smart pointer methods (.ChangePtr() and .get())
  • Maintains existing functionality while improving resource management

@github-project-automation github-project-automation bot moved this from Todo to Integration in Maintenance Jul 18, 2025
@dpasukhi dpasukhi merged commit 45f4afb into Open-Cascade-SAS:IR Jul 18, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance Jul 18, 2025
dpasukhi pushed a commit that referenced this pull request Sep 6, 2025
- Replaces raw IWICBitmapFlipRotator pointer with Image_ComPtr smart pointer wrapper
- Updates pointer access patterns to use smart pointer methods (.ChangePtr() and .get())
- Maintains existing functionality while improving resource management
dpasukhi pushed a commit that referenced this pull request Sep 6, 2025
- Replaces raw IWICBitmapFlipRotator pointer with Image_ComPtr smart pointer wrapper
- Updates pointer access patterns to use smart pointer methods (.ChangePtr() and .get())
- Maintains existing functionality while improving resource management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code 2. Bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Memory leak when loading image from buffer

3 participants