aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-03-01 17:25:49 +0000
committerMax Horn2007-03-01 17:25:49 +0000
commit4efda86d7a50af49914604e6d215e61f1319d95a (patch)
treec586d8646310205d8295d91f2203b34c7312a7a5
parent45bf5749280ddf1530d11d19b34b11768eb0dbb6 (diff)
downloadscummvm-rg350-4efda86d7a50af49914604e6d215e61f1319d95a.tar.gz
scummvm-rg350-4efda86d7a50af49914604e6d215e61f1319d95a.tar.bz2
scummvm-rg350-4efda86d7a50af49914604e6d215e61f1319d95a.zip
Removed File::incRef and decRef
svn-id: r25920
-rw-r--r--common/file.cpp17
-rw-r--r--common/file.h27
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);