diff options
-rw-r--r-- | common/file.cpp | 17 | ||||
-rw-r--r-- | common/file.h | 27 |
2 files changed, 1 insertions, 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); |