Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Small memory leak in source handling #99

Open
FiniteSingularity opened this issue Feb 14, 2024 · 0 comments
Open

[BUG] - Small memory leak in source handling #99

FiniteSingularity opened this issue Feb 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@FiniteSingularity
Copy link
Owner

Describe the bug
If user selects no source, but there was an existing source before, the weak source is not released.

Expected behavior
We should not leak memory!

Additional context
In update function, wherever a weak source is checked, make sure to add pointer check and release if pointer already exists. e.g.:

	if (color_source) {
		obs_weak_source_release(filter->color_source);
		filter->color_source =
			obs_source_get_weak_source(color_source);
		obs_source_release(color_source);
	} else {
		if (filter->color_source) {
			obs_weak_source_release(filter->color_source);
		}
		filter->color_source = NULL;
	}
@FiniteSingularity FiniteSingularity added the bug Something isn't working label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant