Skip to content

Commit

Permalink
RequestHandler: Fix memory leak when setting streaming service
Browse files Browse the repository at this point in the history
  • Loading branch information
norihiro authored and tt2468 committed Jan 16, 2024
1 parent 50b57d3 commit 5b149ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/requesthandler/RequestHandler_Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5b149ad

Please sign in to comment.