Conversation
There was a problem hiding this comment.
Pull request overview
This pull request corrects the plugin display name shown in OBS and addresses a potential resource leak in output handling.
Changes:
- Updated
obs_module_name()to return the correct plugin name ("Logitech G Plugin") instead of the integration name - Added proper release of OBS output resources in the loop function to prevent memory leaks
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| obs_plugin/src/obs_plugin.hpp | Introduced s_plugin_name constant for consistent plugin naming |
| obs_plugin/src/obs_plugin.cpp | Updated module name function to use new constant and added output resource cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| std::condition_variable m_initialization_cv; | ||
|
|
||
| // clang-format off | ||
| const std::string s_plugin_name = "Logitech G Plugin"; |
There was a problem hiding this comment.
The s_plugin_name constant is declared in the header file without being marked as static or inline. This will cause multiple definition errors if this header is included in multiple translation units. Consider marking it as inline (C++17 and later) or moving it to the .cpp file.
|
|
||
| m_total_streamed_frames = streamed_frames; | ||
|
|
||
| obs_output_release(obs_output); |
There was a problem hiding this comment.
The obs_output variable is being released without verifying where it was acquired. If obs_output is obtained from a function that doesn't increment the reference count (like obs_frontend_get_streaming_output()), this release call could cause a premature deallocation. Ensure this release corresponds to a previous acquire/addref call in the same scope.
| obs_output_release(obs_output); | |
| // Note: Do not release obs_output here, as ownership/refcounting is managed elsewhere. |
This pull request updates the plugin metadata and improves resource management in the OBS plugin implementation. The most important changes include correcting the plugin name used by OBS and ensuring proper release of OBS output resources.
Plugin metadata updates:
obs_module_name()inobs_plugin.cppto uses_plugin_nameinstead ofs_integration_name, ensuring OBS displays the correct plugin name.s_plugin_nameconstant ("Logitech G Plugin") to theloginamespace inobs_plugin.hppfor consistent naming.Resource management improvements:
obs_output_release(obs_output)in theloop_function()to properly release OBS output resources and prevent potential memory leaks.