Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 06f2cac

Browse files
committed
Source::parsed is now std::atomic to avoid undefined behaviour
1 parent ed2f58e commit 06f2cac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/source.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ std::string Source::FixIt::string(const Glib::RefPtr<Gtk::TextBuffer> &buffer) {
114114
std::unordered_set<Source::View*> Source::View::non_deleted_views;
115115
std::unordered_set<Source::View*> Source::View::views;
116116

117-
Source::View::View(const boost::filesystem::path &file_path, const Glib::RefPtr<Gsv::Language> &language, bool is_generic_view): BaseView(file_path, language), SpellCheckView(file_path, language), DiffView(file_path, language) {
117+
Source::View::View(const boost::filesystem::path &file_path, const Glib::RefPtr<Gsv::Language> &language, bool is_generic_view): BaseView(file_path, language), SpellCheckView(file_path, language), DiffView(file_path, language), parsed(true) {
118118
non_deleted_views.emplace(this);
119119
views.emplace(this);
120120

src/source.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace Source {
9999
virtual void soft_reparse(bool delayed=false) {soft_reparse_needed=false;}
100100
virtual void full_reparse() {full_reparse_needed=false;}
101101
protected:
102-
bool parsed=true;
102+
std::atomic<bool> parsed;
103103
Tooltips diagnostic_tooltips;
104104
Tooltips type_tooltips;
105105
sigc::connection delayed_tooltips_connection;

0 commit comments

Comments
 (0)