Skip to content

Commit

Permalink
Fix memory leaks (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
itmo153277 authored Oct 9, 2024
1 parent 00576b9 commit 3189fe0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/enhance-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void enhance_filter_update(void *data, obs_data_t *settings)
obs_enter_graphics();

char *effect_path = obs_module_file(BLEND_EFFECT_PATH);
gs_effect_destroy(tf->blendEffect);
tf->blendEffect = gs_effect_create_from_file(effect_path, NULL);
bfree(effect_path);

Expand Down Expand Up @@ -190,6 +189,7 @@ void enhance_filter_destroy(void *data)
if (tf->stagesurface) {
gs_stagesurface_destroy(tf->stagesurface);
}
gs_effect_destroy(tf->blendEffect);
obs_leave_graphics();
tf->~enhance_filter();
bfree(tf);
Expand Down
2 changes: 2 additions & 0 deletions src/obs-utils/obs-config-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ int getConfig(config_t **config)
if (ret != CONFIG_SUCCESS) {
obs_log(LOG_INFO, "Failed to open config file %s",
config_file_path);
bfree(config_file_path);
return OBS_BGREMOVAL_CONFIG_FAIL;
}

bfree(config_file_path);
return OBS_BGREMOVAL_CONFIG_SUCCESS;
}

Expand Down

0 comments on commit 3189fe0

Please sign in to comment.