diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 1b936528..dabf30bc 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -231,7 +231,7 @@ bool WSRequestHandler::hasField(QString name, obs_data_type expectedFieldType, o return false; } - obs_data_item_t* dataItem = obs_data_item_byname(data, name.toUtf8()); + OBSDataItemAutoRelease dataItem = obs_data_item_byname(data, name.toUtf8()); if (!dataItem) { return false; } diff --git a/src/obs-websocket.cpp b/src/obs-websocket.cpp index b780f070..7ec92245 100644 --- a/src/obs-websocket.cpp +++ b/src/obs-websocket.cpp @@ -35,6 +35,11 @@ void ___data_dummy_addref(obs_data_t*) {} void ___data_array_dummy_addref(obs_data_array_t*) {} void ___output_dummy_addref(obs_output_t*) {} +void ___data_item_dummy_addref(obs_data_item_t*) {} +void ___data_item_release(obs_data_item_t* dataItem) { + obs_data_item_release(&dataItem); +} + OBS_DECLARE_MODULE() OBS_MODULE_USE_DEFAULT_LOCALE("obs-websocket", "en-US") diff --git a/src/obs-websocket.h b/src/obs-websocket.h index 011ffcee..1a4dec48 100644 --- a/src/obs-websocket.h +++ b/src/obs-websocket.h @@ -38,6 +38,11 @@ using OBSDataArrayAutoRelease = using OBSOutputAutoRelease = OBSRef; +void ___data_item_dummy_addref(obs_data_item_t*); +void ___data_item_release(obs_data_item_t*); +using OBSDataItemAutoRelease = + OBSRef; + class Config; typedef std::shared_ptr ConfigPtr;