From 4efda86d7a50af49914604e6d215e61f1319d95a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 1 Mar 2007 17:25:49 +0000 Subject: Removed File::incRef and decRef svn-id: r25920 --- common/file.cpp | 17 +---------------- common/file.h | 27 --------------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/common/file.cpp b/common/file.cpp index 68360ce1d8..aecc1cf8d3 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -167,7 +167,7 @@ void File::resetDefaultDirectories() { } File::File() - : _handle(0), _ioFailed(false), _refcount(1) { + : _handle(0), _ioFailed(false) { } //#define DEBUG_FILE_REFCOUNT @@ -178,21 +178,6 @@ File::~File() { #endif close(); } -void File::incRef() { -#ifdef DEBUG_FILE_REFCOUNT - warning("File::incRef on file '%s'", _name.c_str()); -#endif - _refcount++; -} - -void File::decRef() { -#ifdef DEBUG_FILE_REFCOUNT - warning("File::decRef on file '%s'", _name.c_str()); -#endif - if (--_refcount == 0) { - delete this; - } -} bool File::open(const String &filename, AccessMode mode) { diff --git a/common/file.h b/common/file.h index 13102a7bcb..2b41522c2b 100644 --- a/common/file.h +++ b/common/file.h @@ -40,9 +40,6 @@ protected: /** Status flag which tells about recent I/O failures. */ bool _ioFailed; - /** Simple ref-counter for File objects. */ - int32 _refcount; - /** The name of this file, for debugging. */ String _name; @@ -81,30 +78,6 @@ public: */ static bool exists(const String &filename); - /** - * Increases the reference counter of the file object. - * This can be used to share file objects between different - * parts of the code. Some systems (like Symbian don't support - * it thought). It should just be used on file objects - * allocated with new, since decRef destroys the object - * with delete if the counter reaches zero. - * - * This is a possible candidate to be reworked in the future - * see the TODO list for more information. - */ - void incRef(); - - /** - * Decreases the reference counter of the file object. - * If the counter is zero after this call, the file object will - * be deleted, with delete. It should just be used on file objects - * allocated with new out of that reason. - * - * This is a possible candidate to be reworked in the future - * see the TODO list for more information. - */ - void decRef(); - virtual bool open(const String &filename, AccessMode mode = kFileReadMode); virtual bool open(const FilesystemNode &node, AccessMode mode = kFileReadMode); -- cgit v1.2.3