RequestHandler: Fix memory leak when setting streaming service

This commit is contained in:
Norihiro Kamae 2023-05-08 01:24:50 +09:00 committed by tt2468
parent 50b57d38d0
commit 5b149add99

View File

@ -599,9 +599,9 @@ RequestResult RequestHandler::SetStreamServiceSettings(const Request &request)
obs_service_update(currentStreamService, newStreamServiceSettings);
} else {
// TODO: This leaks memory. I have no idea why.
OBSService newStreamService = obs_service_create(requestedStreamServiceType.c_str(), "obs_websocket_custom_service",
requestedStreamServiceSettings, nullptr);
OBSServiceAutoRelease newStreamService = obs_service_create(requestedStreamServiceType.c_str(),
"obs_websocket_custom_service",
requestedStreamServiceSettings, nullptr);
// TODO: Check service type here, instead of relying on service creation to fail.
if (!newStreamService)
return RequestResult::Error(