diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-04-10 18:54:01 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-04-10 18:54:01 +0200 |
| commit | 9999e5698d50b384eb95181ef06db4cc99c90bb2 (patch) | |
| tree | 2e1fb8eafc82fa4c662afd75c044589283c39ad2 /src/file.cc | |
| parent | 441f9a69efc18630b4c508688ef403b0ed81b19d (diff) | |
Use the buffer manager to delete buffer, throw when a client is inserting
Diffstat (limited to 'src/file.cc')
| -rw-r--r-- | src/file.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/file.cc b/src/file.cc index 86597681..1e9b7327 100644 --- a/src/file.cc +++ b/src/file.cc @@ -133,8 +133,7 @@ Buffer* create_buffer_from_file(String filename) const char* data = (const char*)mmap(nullptr, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); auto cleanup = on_scope_end([&]{ munmap((void*)data, st.st_size); close(fd); }); - if (Buffer* buffer = BufferManager::instance().get_buffer_ifp(filename)) - delete buffer; + BufferManager::instance().delete_buffer_if_exists(filename); const char* pos = data; bool crlf = false; |
