Skip to content

Conversation

@xd-byte
Copy link
Contributor

@xd-byte xd-byte commented Oct 16, 2025

This PR fixes a memory leak issue in the Windows DXGI adapter enumeration code. Previously, dxgi::adapter_t instances were passed directly to EnumAdapters1(), which expects a raw IDXGIAdapter1**. This could cause the internal pointer of dxgi::adapter_t (a uniq_ptr wrapper) to be overwritten, leading to potential memory leaks or invalid pointer access.

@codecov
Copy link

codecov bot commented Oct 16, 2025

Bundle Report

Bundle size has no change ✅

@ReenigneArcher
Copy link
Member

Thank you for the PR!

Could you fix the lint errors?

Also, do you think this will fix the memory leak reported in #4338?

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.10%. Comparing base (7ecb781) to head (5e37626).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/windows/display_base.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #4340    +/-   ##
========================================
  Coverage   12.10%   12.10%            
========================================
  Files          87       87            
  Lines       17610    17610            
  Branches     8095     8096     +1     
========================================
  Hits         2131     2131            
+ Misses      14756    14577   -179     
- Partials      723      902   +179     
Flag Coverage Δ
Linux-AppImage 11.62% <ø> (ø)
Windows-AMD64 13.41% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/windows/display_base.cpp 35.59% <0.00%> (ø)

... and 21 files with indirect coverage changes

@xd-byte xd-byte force-pushed the fix-windows-memory-leak branch from f42177b to 95db540 Compare October 17, 2025 01:35
@xd-byte
Copy link
Contributor Author

xd-byte commented Oct 17, 2025

Thank you for the PR!

Could you fix the lint errors?

Also, do you think this will fix the memory leak reported in #4338?

I have fixed the lint errors. Also, I don't think this fixes #4338, IDXGIAdapter1 won't take up that much memory.

@ReenigneArcher
Copy link
Member

@xd-byte the commit is coauthored by another git account, is that intentional?

@xd-byte xd-byte force-pushed the fix-windows-memory-leak branch from 95db540 to 05d49be Compare October 23, 2025 02:13
@xd-byte
Copy link
Contributor Author

xd-byte commented Oct 23, 2025

@xd-byte the commit is coauthored by another git account, is that intentional?

Thanks for noticing! I’ve updated the commits so the author now matches my GitHub account and force-pushed the branch.

@ReenigneArcher ReenigneArcher force-pushed the fix-windows-memory-leak branch from 05d49be to 5e37626 Compare October 25, 2025 14:21
@sonarqubecloud
Copy link

@ReenigneArcher ReenigneArcher merged commit d3af56d into LizardByte:master Oct 25, 2025
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants