Unverified Commit e8daf7c7 authored by Gabi Melman's avatar Gabi Melman Committed by GitHub

Merge pull request #1431 from tt4g/avoid-references-to-race-data-filename

Avoid references to race data filename
parents a343328a 0cf1af5b
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
} }
} }
const filename_t &filename() filename_t filename()
{ {
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_); std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
return file_helper_.filename(); return file_helper_.filename();
......
...@@ -54,7 +54,7 @@ SPDLOG_INLINE filename_t rotating_file_sink<Mutex>::calc_filename(const filename ...@@ -54,7 +54,7 @@ SPDLOG_INLINE filename_t rotating_file_sink<Mutex>::calc_filename(const filename
} }
template<typename Mutex> template<typename Mutex>
SPDLOG_INLINE const filename_t &rotating_file_sink<Mutex>::filename() SPDLOG_INLINE filename_t rotating_file_sink<Mutex>::filename()
{ {
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_); std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
return file_helper_.filename(); return file_helper_.filename();
......
...@@ -24,7 +24,7 @@ class rotating_file_sink final : public base_sink<Mutex> ...@@ -24,7 +24,7 @@ class rotating_file_sink final : public base_sink<Mutex>
public: public:
rotating_file_sink(filename_t base_filename, std::size_t max_size, std::size_t max_files, bool rotate_on_open = false); rotating_file_sink(filename_t base_filename, std::size_t max_size, std::size_t max_files, bool rotate_on_open = false);
static filename_t calc_filename(const filename_t &filename, std::size_t index); static filename_t calc_filename(const filename_t &filename, std::size_t index);
const filename_t &filename(); filename_t filename();
protected: protected:
void sink_it_(const details::log_msg &msg) override; void sink_it_(const details::log_msg &msg) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment