diff options
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r-- | lib/Handle.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc index 685c4a4..7313d92 100644 --- a/lib/Handle.cc +++ b/lib/Handle.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: Handle.cc,v 1.80 2007-05-30 11:57:09 pixel Exp $ */ +/* $Id: Handle.cc,v 1.81 2008-01-21 17:19:07 pixel Exp $ */ #include <stdio.h> #include <string.h> @@ -62,6 +62,8 @@ enum { INFLATE }; +int Handle::nb_handles = 0; + Handle::Handle(const Handle & nh) : itell(0), hFile(0), h(nh.h >= 0 ? nh.ndup() : nh.h), closed(nh.closed), nonblock(nh.closed), zfile(0), z(0), hMapObject(0), mapped(0) { #ifdef DEBUG @@ -70,6 +72,7 @@ Handle::Handle(const Handle & nh) : itell(0), hFile(0), h(nh.h >= 0 ? nh.ndup() if ((h >= 0) && (nh.z)) { SetZ(nh.z); } + nb_handles++; } Handle::~Handle() { @@ -77,6 +80,7 @@ Handle::~Handle() { printm(M_INFO, String(_("Destroying handle ")) + h + "\n"); #endif close(); + nb_handles--; } Handle::Handle(int nh) : itell(0), h(nh), closed(false), nonblock(false), zfile(0), z(0), hMapObject(0), mapped(0) @@ -84,6 +88,7 @@ Handle::Handle(int nh) : itell(0), h(nh), closed(false), nonblock(false), zfile( #ifdef DEBUG printm(M_INFO, String(_("Initialising handle ")) + h + "\n"); #endif + nb_handles++; } int Handle::GetHandle() { @@ -691,3 +696,7 @@ int Handle::ndup() const throw (GeneralException) { int Handle::nclose() throw (GeneralException) { return ::close(h); } + +int Handle::GetNbHandles() { + return nb_handles; +} |