Commit 96b25aaf by Ben Clayton Committed by Ben Clayton

src/io.cpp: Fix uninitialized variable.

`std::atomic<bool>` does not default initialize to `false`. Bug: #12
parent 93b86100
......@@ -130,7 +130,6 @@ class File : public dap::ReaderWriter {
out[i] = char(c);
}
return n;
// return fread(buffer, 1, n, f);
}
bool write(const void* buffer, size_t n) override {
std::unique_lock<std::mutex> lock(writeMutex);
......@@ -143,10 +142,10 @@ class File : public dap::ReaderWriter {
private:
FILE* const f;
const bool closable;
std::mutex readMutex;
std::mutex writeMutex;
std::atomic<bool> closed;
const bool closable;
std::atomic<bool> closed = { false };
};
class ReaderSpy : public dap::Reader {
......
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