Skip to content

Commit

Permalink
Fixes memory leak in move-value filter when Settings is selected as t…
Browse files Browse the repository at this point in the history
…he Move Value Type. (#217)
  • Loading branch information
FiniteSingularity authored Jul 2, 2024
1 parent 3381895 commit 6b9d5cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# ignore generated files
*.generated.*
**/.Brewfile.lock.json
version.h
move-transition.rc
5 changes: 5 additions & 0 deletions move-value-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static void load_properties(obs_properties_t *props_from, obs_data_array_t *arra
const char *setting_name2 = obs_data_get_string(item2, S_SETTING_NAME);
if (strcmp(setting_name2, name) == 0) {
setting = item2;
obs_data_addref(setting);
}
obs_data_release(item2);
}
Expand Down Expand Up @@ -181,6 +182,9 @@ static void load_properties(obs_properties_t *props_from, obs_data_array_t *arra
const long long from = obs_data_get_int(settings_from, name);
obs_data_set_int(setting, S_SETTING_FROM, from);
}
if (setting) {
obs_data_release(setting);
}
}
}

Expand All @@ -192,6 +196,7 @@ void move_values_load_properties(struct move_value_info *move_value, obs_source_
while (index < obs_data_array_count(move_value->settings)) {
obs_data_t *item = obs_data_array_item(move_value->settings, index);
const char *setting_name = obs_data_get_string(item, S_SETTING_NAME);
obs_data_release(item);
if (obs_properties_get(sps, setting_name) == NULL) {
obs_data_array_erase(move_value->settings, index);
} else {
Expand Down

0 comments on commit 6b9d5cb

Please sign in to comment.