Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Commit

Permalink
#115 Fix segfault on OSX, Windows and AppImage
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinDuquesnoy committed Sep 17, 2017
1 parent b6dac23 commit 45800be
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ QList<shared_ptr<StreamingService>> StreamingServiceLoader::load() const
for (const QFileInfo& directory : QDir(path).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
if (checkServiceDirectory(directory.absoluteFilePath())) {
shared_ptr<StreamingService> service = loadService(directory.absoluteFilePath());
if (service == nullptr)
continue;
if (service->isValid() && !containsService(services, service)) {
LOG_DEBUG(logger_, service->name() + " streamingService successfully loaded (from \"" + directory.absoluteFilePath() + "\")");
services.append(service);
Expand Down Expand Up @@ -74,7 +76,7 @@ StreamingServiceMetadata StreamingServiceLoader::readMetadata(const QString& fil
QSettings meta(filePath, QSettings::IniFormat);

QString supportedPlatforms = meta.value("supported_platforms").toString();

if (platformFilters_.match(supportedPlatforms)) {
StreamingServiceMetadata serviceMetadata;
serviceMetadata.author = meta.value("author").toString();
Expand All @@ -83,10 +85,10 @@ StreamingServiceMetadata StreamingServiceLoader::readMetadata(const QString& fil
serviceMetadata.name = meta.value("name").toString();
serviceMetadata.url = meta.value("url").toString();
serviceMetadata.version = meta.value("version").toString();
return serviceMetadata;
}
else

return serviceMetadata;
}
else
throw runtime_error("plugin not supported");
}

Expand All @@ -111,7 +113,7 @@ unique_ptr<StreamingService> StreamingServiceLoader::loadService(const QString&
LOG_INFO(logger_, "plugin is not supported on this platform");
return nullptr;
}

metadata.pluginDirectory = directory;
metadata.script = readFileContent(scriptPath);
metadata.scriptPath = scriptPath;
Expand Down

0 comments on commit 45800be

Please sign in to comment.