Skip to content

Commit a935b64

Browse files
committed
use OBSDataAutoRelease (RAII) to release resources
1 parent ee0b47e commit a935b64

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

obs-studio-server/source/nodeobs_settings.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,7 +3868,7 @@ void OBS_settings::saveGenericSettings(std::vector<SubCategory> genericSettings,
38683868

38693869
void getDevices(const char *source_id, const char *property_name, std::vector<ipc::value> &rval)
38703870
{
3871-
auto settings = obs_get_source_defaults(source_id);
3871+
OBSDataAutoRelease settings = obs_get_source_defaults(source_id);
38723872
if (!settings)
38733873
return;
38743874

@@ -3881,7 +3881,6 @@ void getDevices(const char *source_id, const char *property_name, std::vector<ip
38813881

38823882
auto props = obs_get_source_properties(source_id);
38833883
if (!props) {
3884-
obs_data_release(settings);
38853884
blog(LOG_WARNING, "Could not get source properties for source id: %s", source_id);
38863885
return;
38873886
}
@@ -3890,7 +3889,6 @@ void getDevices(const char *source_id, const char *property_name, std::vector<ip
38903889
if (!prop) {
38913890
blog(LOG_WARNING, "Could not get the property [%s] for source id: %s", property_name, source_id);
38923891
obs_properties_destroy(props);
3893-
obs_data_release(settings);
38943892
return;
38953893
}
38963894

@@ -3914,7 +3912,6 @@ void getDevices(const char *source_id, const char *property_name, std::vector<ip
39143912
}
39153913

39163914
obs_properties_destroy(props);
3917-
obs_data_release(settings);
39183915
}
39193916

39203917
#ifdef WIN32

0 commit comments

Comments
 (0)