Buffer: not copyable, add destructor

This commit is contained in:
Maxime Coste 2011-10-24 14:23:13 +00:00
parent 12d933d896
commit bace526fa3
2 changed files with 10 additions and 0 deletions

View File

@ -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,

View File

@ -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();