summaryrefslogtreecommitdiff
path: root/src/buffer_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-06-28 13:45:42 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-06-28 13:45:42 +0200
commit4dfc910195985d5d345fb6800f09bd9de3acd487 (patch)
tree144d5ad6267c8b944b81cffed91718d54ed33816 /src/buffer_manager.hh
parent1289268174a4a5aec2090a86de5c0c0ddc6d40ee (diff)
BufferManager use safe_ptr to reference the Buffers
Diffstat (limited to 'src/buffer_manager.hh')
-rw-r--r--src/buffer_manager.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer_manager.hh b/src/buffer_manager.hh
index beba6652..80198942 100644
--- a/src/buffer_manager.hh
+++ b/src/buffer_manager.hh
@@ -14,7 +14,7 @@ class Buffer;
class BufferManager : public Singleton<BufferManager>
{
public:
- typedef std::unordered_map<String, Buffer*> BufferMap;
+ typedef std::unordered_map<String, safe_ptr<Buffer>> BufferMap;
struct iterator : public BufferMap::const_iterator
{
@@ -23,7 +23,7 @@ public:
iterator() {}
iterator(const parent_type& other) : parent_type(other) {}
Buffer& operator*() const { return *(parent_type::operator*().second); }
- Buffer* operator->() const { return parent_type::operator*().second; }
+ Buffer* operator->() const { return parent_type::operator*().second.get(); }
};
~BufferManager();