diff --git a/src/buffer.cc b/src/buffer.cc index cf60fa84..f9aac0b8 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -29,6 +29,12 @@ Buffer::Buffer(const std::string& name, Type type, compute_lines(); } +Buffer::~Buffer() +{ + m_windows.clear(); + assert(m_modification_listeners.empty()); +} + void Buffer::erase(const BufferIterator& begin, const BufferIterator& end) { append_modification(BufferModification(BufferModification::Erase, diff --git a/src/buffer.hh b/src/buffer.hh index f586af7c..aee9fba2 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -104,6 +104,10 @@ public: Buffer(const std::string& name, Type type, const BufferString& initial_content = ""); + Buffer(const Buffer&) = delete; + Buffer(Buffer&&) = delete; + Buffer& operator= (const Buffer&) = delete; + ~Buffer(); void begin_undo_group(); void end_undo_group();