From 06f2caca8e09b70dc8d62a46aba4fde948ab7b51 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 28 May 2018 18:30:39 +0200 Subject: [PATCH] Source::parsed is now std::atomic to avoid undefined behaviour --- src/source.cc | 2 +- src/source.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/source.cc b/src/source.cc index 6e5d40b..8ecc21f 100644 --- a/src/source.cc +++ b/src/source.cc @@ -114,7 +114,7 @@ std::string Source::FixIt::string(const Glib::RefPtr &buffer) { std::unordered_set Source::View::non_deleted_views; std::unordered_set Source::View::views; -Source::View::View(const boost::filesystem::path &file_path, const Glib::RefPtr &language, bool is_generic_view): BaseView(file_path, language), SpellCheckView(file_path, language), DiffView(file_path, language) { +Source::View::View(const boost::filesystem::path &file_path, const Glib::RefPtr &language, bool is_generic_view): BaseView(file_path, language), SpellCheckView(file_path, language), DiffView(file_path, language), parsed(true) { non_deleted_views.emplace(this); views.emplace(this); diff --git a/src/source.h b/src/source.h index 16a23f8..a49133e 100644 --- a/src/source.h +++ b/src/source.h @@ -99,7 +99,7 @@ namespace Source { virtual void soft_reparse(bool delayed=false) {soft_reparse_needed=false;} virtual void full_reparse() {full_reparse_needed=false;} protected: - bool parsed=true; + std::atomic parsed; Tooltips diagnostic_tooltips; Tooltips type_tooltips; sigc::connection delayed_tooltips_connection;