[Scummvm-cvs-logs] SF.net SVN: scummvm: [25920] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Mar 1 18:25:50 CET 2007


Revision: 25920
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25920&view=rev
Author:   fingolfin
Date:     2007-03-01 09:25:49 -0800 (Thu, 01 Mar 2007)

Log Message:
-----------
Removed File::incRef and decRef

Modified Paths:
--------------
    scummvm/trunk/common/file.cpp
    scummvm/trunk/common/file.h

Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp	2007-03-01 17:22:30 UTC (rev 25919)
+++ scummvm/trunk/common/file.cpp	2007-03-01 17:25:49 UTC (rev 25920)
@@ -167,7 +167,7 @@
 }
 
 File::File()
-	: _handle(0), _ioFailed(false), _refcount(1) {
+	: _handle(0), _ioFailed(false) {
 }
 
 //#define DEBUG_FILE_REFCOUNT
@@ -178,23 +178,8 @@
 #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) {
 	assert(mode == kFileReadMode || mode == kFileWriteMode);
 

Modified: scummvm/trunk/common/file.h
===================================================================
--- scummvm/trunk/common/file.h	2007-03-01 17:22:30 UTC (rev 25919)
+++ scummvm/trunk/common/file.h	2007-03-01 17:25:49 UTC (rev 25920)
@@ -40,9 +40,6 @@
 	/** 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 @@
 	 */
 	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);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list