From d8d861c3db5e33870c41864c3f16ead17732935a Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 15 Jun 2024 12:39:35 +0200 Subject: Assign `CreateInterface` member instead of creating a new variable (#705) Assign CreateInterface member instead of creating a new variable. This fixes valid Plugins failing to load. --- primedev/plugins/plugins.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'primedev') diff --git a/primedev/plugins/plugins.cpp b/primedev/plugins/plugins.cpp index ae6fd0cb..03dd2c9e 100644 --- a/primedev/plugins/plugins.cpp +++ b/primedev/plugins/plugins.cpp @@ -45,15 +45,15 @@ Plugin::Plugin(std::string path) : m_location(path) m_initData = {.pluginHandle = m_handle}; - CreateInterfaceFn CreatePluginInterface = (CreateInterfaceFn)GetProcAddress(m_handle, "CreateInterface"); + m_pCreateInterface = (CreateInterfaceFn)GetProcAddress(m_handle, "CreateInterface"); - if (!CreatePluginInterface) + if (!m_pCreateInterface) { NS::log::PLUGINSYS->error("Plugin at '{}' does not expose CreateInterface()", path); return; } - m_pluginId = (IPluginId*)CreatePluginInterface(PLUGIN_ID_VERSION, 0); + m_pluginId = (IPluginId*)m_pCreateInterface(PLUGIN_ID_VERSION, 0); if (!m_pluginId) { @@ -97,7 +97,7 @@ Plugin::Plugin(std::string path) : m_location(path) return; } - m_callbacks = (IPluginCallbacks*)CreatePluginInterface("PluginCallbacks001", 0); + m_callbacks = (IPluginCallbacks*)m_pCreateInterface("PluginCallbacks001", 0); if (!m_callbacks) { -- cgit v1.2.3