Skip to content

Commit

Permalink
FIX: Overwrite init function for legacy plugins
Browse files Browse the repository at this point in the history
Legacy plugins have to skip the init procedure as they don't work that
way. In order to achieve that, they have to override the init function
and basically turn this into a (more or less= no-opt.
  • Loading branch information
Krzmbrzl committed Apr 16, 2021
1 parent 94871bc commit 769bf70
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/mumble/LegacyPlugin.cpp
Expand Up @@ -119,6 +119,18 @@ void LegacyPlugin::resolveFunctionPointers() {
}
}

mumble_error_t LegacyPlugin::init() {
{
QWriteLocker lock(&m_pluginLock);

m_pluginIsLoaded = true;
}

// No-op as legacy plugins never have anything to initialize
// The only init function they care about is the one that inits positional audio
return STATUS_OK;
}

QString LegacyPlugin::getName() const {
PluginReadLocker lock(&m_pluginLock);

Expand Down
2 changes: 2 additions & 0 deletions src/mumble/LegacyPlugin.h
Expand Up @@ -63,6 +63,8 @@ class LegacyPlugin : public Plugin {
public:
virtual ~LegacyPlugin() override;

virtual mumble_error_t init() override;

// functions for direct plugin-interaction
virtual QString getName() const override;

Expand Down

0 comments on commit 769bf70

Please sign in to comment.