FiniteSingularity / obs-composite-blur

A comprehensive blur plugin for OBS that provides several different blur algorithms, and proper compositing.
GNU General Public License v2.0
319 stars 27 forks source link

[BUG] - Runaway memory leak with Composite Blur filter applied to capture source with no connected application #82

Closed Poodmund closed 9 months ago

Poodmund commented 9 months ago

Describe the bug I am seeming to get a runaway memory leak in certain conditions when using the Composite Blur plugin when I switch between scenes that have a composite blur filter applied to Window or Game Capture sources, when the sources are active, but the sources have no application to connect to (therefore the filter is being applied to nothing).

The example in this case occurs when switching between a scenes containing a desktop capture source, a scene containing a Chrome window capture source, a scene containing a game capture source that is visible but the game is not running and a scene containing an application capture source that is visible but the application is not running. Both of this capture sources have a composite blur filter applied to them using:

To Reproduce Steps to reproduce the behavior:

  1. Create two scenes, (a) one being blank and (b) one with a Window/Game capture source of an open application and apply a Composite Blur filter against the captured sourced BUT importantly, close the application so that the source is not connected to the application.
  2. Navigate to the blank scene (a).
  3. Navigate back to the scene with the Composite Blur filter (b) and notice that the memory allocated to OBS runs away to max capacity in a few seconds.

Expected behavior I would expect that the Composite Blur filter being applied to the capture source is not being applied to the source when there is not texture to render.

Environment

GPU

Additional context Early investigation by FiniteSingularity: "I have an early exit for the filters if they don't see a texture to blur. I was properly cleaning things up, but didn't early-exit the masking code. So, its the attempted mask on the non-running source that is causing the issue, not the non-running source itself."

Poodmund commented 9 months ago

Tested the build from https://github.com/FiniteSingularity/obs-composite-blur/actions/runs/6290618877 and it appears to resolve my issue. Thank you.

FiniteSingularity commented 9 months ago

@all-contributors please add @Poodmund for bug

allcontributors[bot] commented 9 months ago

@FiniteSingularity

I've put up a pull request to add @Poodmund! :tada:

FiniteSingularity commented 9 months ago

@Poodmund, thank you for the bug report, and for confirming the fix. Just merged that PR into the main branch, and will make a new release.