Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 40ad0795 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

FIX: Fix segfault -> create the stores on application startup

parent 6b8cc899
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!21Add clean logs support + dependent MR
Ce commit fait partie de la requête de fusion !21. Les commentaires créés ici seront créés dans le contexte de cette requête de fusion.
...@@ -9,8 +9,9 @@ VivyDocumentStore::newDocument(VivyDocument::Options opt) ...@@ -9,8 +9,9 @@ VivyDocumentStore::newDocument(VivyDocument::Options opt)
// Add the memory flag // Add the memory flag
opt = static_cast<VivyDocument::Options>(opt | VivyDocument::MemoryDocumentCreation); opt = static_cast<VivyDocument::Options>(opt | VivyDocument::MemoryDocumentCreation);
const QString newDocName = newDocumentBaseName + QString::number(newDocumentNumber++); const QString newDocName = newDocumentBaseName + QString::number(newDocumentNumber);
auto ret = std::make_shared<VivyDocument>(newDocName, opt); auto ret = std::make_shared<VivyDocument>(newDocName, opt);
newDocumentNumber++;
if (ret) { if (ret) {
const Uuid uuid = ret->getUuid(); const Uuid uuid = ret->getUuid();
......
...@@ -40,7 +40,7 @@ StderrLogSinkDispatcher::handleLogMessage(const std::string_view category, ...@@ -40,7 +40,7 @@ StderrLogSinkDispatcher::handleLogMessage(const std::string_view category,
{ {
std::cerr << "#(" << trunkFileName(msg.getHeader().fileName) << " +" std::cerr << "#(" << trunkFileName(msg.getHeader().fileName) << " +"
<< msg.getHeader().lineNumberInFile << " | " << msg.getHeader().lineNumberInFile << " | "
<< LogLevel::toStdStringView(msg.getHeader().severity) << " -> " << category << ")\t" << LogLevel::toStdStringView(msg.getHeader().severity) << " -> " << category << ") "
<< msg.getTextBuffer() << '\n'; << msg.getTextBuffer() << '\n';
} }
} }
......
#include "VivyApplication.hh" #include "VivyApplication.hh"
#include "UI/MainWindow.hh" #include "UI/MainWindow.hh"
#include "Lib/Document/VivyDocumentStore.hh"
#include "Lib/Script/ScriptStore.hh"
using namespace Vivy; using namespace Vivy;
VivyApplication::VivyApplication(int &argc, char **argv) VivyApplication::VivyApplication(int &argc, char **argv)
: QApplication(argc, argv) : QApplication(argc, argv)
{ {
documentStore = std::make_shared<VivyDocumentStore>();
scriptStore = std::make_shared<ScriptStore>();
VIVY_LOG_CTOR() << "Construction is OK"; VIVY_LOG_CTOR() << "Construction is OK";
} }
......
...@@ -46,8 +46,8 @@ class VivyApplication : public QApplication { ...@@ -46,8 +46,8 @@ class VivyApplication : public QApplication {
VIVY_LOGGABLE_OBJECT(logSink, APPLICATION, logger) VIVY_LOGGABLE_OBJECT(logSink, APPLICATION, logger)
public: public:
std::shared_ptr<VivyDocumentStore> documentStore{}; std::shared_ptr<VivyDocumentStore> documentStore;
std::shared_ptr<ScriptStore> scriptStore{}; std::shared_ptr<ScriptStore> scriptStore;
enum class Font { enum class Font {
Monospace, Monospace,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter