solve some bugs

This commit is contained in:
2026-01-05 18:01:13 +08:00
parent 6b64abb1fa
commit 8ed5660faf
17 changed files with 203 additions and 79 deletions
+12 -7
View File
@@ -71,15 +71,20 @@ void AddPluginPathsFromEnv(OFX::Host::PluginCache *cache, const char *env_var)
void olive::plugin::loadPlugins(QString path)
{
std::shared_ptr<OliveHost> host = std::make_shared<OliveHost>();
Current::getInstance().setPluginHost(host);
std::shared_ptr<OliveHost> host = Current::getInstance().pluginHost();
std::shared_ptr<ImageEffect::PluginCache> imageEffectPluginCache =
std::make_shared<ImageEffect::PluginCache>(*host);
Current::getInstance().setPluginCache(imageEffectPluginCache);
Current::getInstance().pluginCache();
imageEffectPluginCache->registerInCache(
*OFX::Host::PluginCache::getPluginCache());
if (!host || !imageEffectPluginCache) {
host = std::make_shared<OliveHost>();
Current::getInstance().setPluginHost(host);
imageEffectPluginCache = std::make_shared<ImageEffect::PluginCache>(*host);
Current::getInstance().setPluginCache(imageEffectPluginCache);
imageEffectPluginCache->registerInCache(
*OFX::Host::PluginCache::getPluginCache());
}
OFX::Host::PluginCache *cache = OFX::Host::PluginCache::getPluginCache();
cache->setPluginHostPath("Olive");