diff options
-rw-r--r-- | backends/fs/fs.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/backends/fs/fs.cpp b/backends/fs/fs.cpp index f111e78a0f..ca0ac2d7d7 100644 --- a/backends/fs/fs.cpp +++ b/backends/fs/fs.cpp @@ -37,6 +37,7 @@ FilesystemNode::FilesystemNode(AbstractFilesystemNode *realNode) { FilesystemNode::FilesystemNode() { if (_rootNode == 0) { _rootNode = AbstractFilesystemNode::getRoot(); + assert(_rootNode); _rootRefCount = new int(1); } _realNode = _rootNode; @@ -60,8 +61,9 @@ FilesystemNode::~FilesystemNode() { } void FilesystemNode::decRefCount() { + assert(*_refCount > 0); --(*_refCount); - if (*_refCount <= 0) { + if (*_refCount == 0) { delete _refCount; delete _realNode; } |