From 809025e47c61293ab7302032b5b5175f8f64d161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 31 May 2005 01:18:34 +0000 Subject: [PATCH] BlockArray::MakeEmpty() can now also be called before the block has been actually used. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12911 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Utility.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Utility.cpp b/src/add-ons/kernel/file_systems/bfs/Utility.cpp index 8e01fcb459..d409b2006e 100644 --- a/src/add-ons/kernel/file_systems/bfs/Utility.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Utility.cpp @@ -1,8 +1,8 @@ /* Utility - some helper classes -** -** Initial version by Axel Dörfler, axeld@pinc-software.de -** This file may be used under the terms of the OpenBeOS License. -*/ + * + * Copyright 2001-2005, Axel Dörfler, axeld@pinc-software.de. + * This file may be used under the terms of the MIT License. + */ #include "Utility.h" @@ -85,8 +85,7 @@ BlockArray::BlockArray(int32 blockSize) BlockArray::~BlockArray() { - if (fArray) - free(fArray); + free(fArray); } @@ -134,7 +133,8 @@ BlockArray::Remove(off_t value) void BlockArray::MakeEmpty() { - fArray->count = 0; + if (fArray != NULL) + fArray->count = 0; }