Skip to content

bugfix(w3d): Fix leaked surface copy in screenshot capture - #636

Open
tintinhamans wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/screenshot-surface-leak
Open

tintinhamans wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/go/fix/screenshot-surface-leak

Conversation

@tintinhamans

Copy link
Copy Markdown

_Create_DX8_Surface returns a surface that already holds one reference. W3D_TakeCompressedScreenshot wraps it with the SurfaceClass(IDirect3DSurface8*) constructor, which goes through Attach and takes a second one. ~SurfaceClass releases one, so every screenshot leaks a back buffer sized image surface.

The copy is now built with SurfaceClass(width, height, format), which owns the only reference. Same image surface, same blit, same lock. The probe capture in OnlineServices_Init.cpp already releases its raw surface and is not affected.

Upstream: TheSuperHackers#3477

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.

1 participant