Skip to content

Fix plugin display name#12

Open
LogitechG-Antonpup wants to merge 2 commits intomasterfrom
fixes/plugin_display_name
Open

Fix plugin display name#12
LogitechG-Antonpup wants to merge 2 commits intomasterfrom
fixes/plugin_display_name

Conversation

@LogitechG-Antonpup
Copy link
Contributor

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:

  • Changed the return value of obs_module_name() in obs_plugin.cpp to use s_plugin_name instead of s_integration_name, ensuring OBS displays the correct plugin name.
  • Added the s_plugin_name constant ("Logitech G Plugin") to the logi namespace in obs_plugin.hpp for consistent naming.

Resource management improvements:

  • Added a call to obs_output_release(obs_output) in the loop_function() to properly release OBS output resources and prevent potential memory leaks.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

m_total_streamed_frames = streamed_frames;

obs_output_release(obs_output);
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
obs_output_release(obs_output);
// Note: Do not release obs_output here, as ownership/refcounting is managed elsewhere.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant