diff --git a/include/ByteStream.h b/include/ByteStream.h index 02330e17d948486e5a5ddde3c6f86a65a40996a8..64a7b7ba846e1b87a7fd069ffb05c4b9f0059ef9 100644 --- a/include/ByteStream.h +++ b/include/ByteStream.h @@ -129,14 +129,6 @@ public: /// Pointer to the stream byte* stream; - static dword count_object; - - static dword count_object2; - - static dword count_object_deleted; - - static dword count_object_deleted2; - protected: /// Internal use only for memory management diff --git a/include/SharedPtr.h b/include/SharedPtr.h index 2eb355806f32595f557305ee239fc4ae1c74953d..f62c6c97e0e3038b7a483a3a39297d7acdeac7d4 100644 --- a/include/SharedPtr.h +++ b/include/SharedPtr.h @@ -32,7 +32,7 @@ class SharedPtr SharedPtr() : p(0), c(0) {} explicit SharedPtr(T* s) : p(s), c(new unsigned(1)) {} - SharedPtr(int null) : p(0), c(0) {} + SharedPtr(void* null) : p(0), c(0) {} SharedPtr(const SharedPtr& s) : p(s.p), c(s.c) { if(c) ++*c; } diff --git a/src/ByteStream.cpp b/src/ByteStream.cpp index f7addebbff772b9c05750d95271d51d45837181e..832ac16ae96db64d964e870aacf9e2c555e052d8 100644 --- a/src/ByteStream.cpp +++ b/src/ByteStream.cpp @@ -21,14 +21,6 @@ #include "Utility.h" using namespace PacketLib; -/// Objects that deallocate memory -dword ByteStream::count_object = 0; -/// Objects that do not deallocate memory -dword ByteStream::count_object2 = 0; -dword ByteStream::count_object_deleted = 0; -dword ByteStream::count_object_deleted2 = 0; - - /// Returns a pointer of a field in the list of fields of this part of packet. /// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer. /// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied. @@ -137,15 +129,9 @@ PacketLib::ByteStream::~ByteStream() { if(mem_allocation) { - ByteStream::count_object_deleted++; - //cout << "ByteStream::~ByteStream() delete[] stream;" << endl; delete[] stream; stream = 0; } - else - ; - // ByteStream::count_object_deleted2++; - //cout << "ByteStream::~ByteStream()" << endl; } @@ -382,47 +368,11 @@ void PacketLib::ByteStream::swapWordIfStreamIsBigEndian() } } - - void PacketLib::ByteStream::setMemoryAllocated(bool allocated) { - - if(allocated) - { - if(mem_allocation_constructor) - { - ByteStream::count_object ++; - } - else - { - if(mem_allocation == false) - { - ByteStream::count_object2 --; - ByteStream::count_object ++; - } - } - mem_allocation = allocated; - } - else - { - if(mem_allocation_constructor) - { - ByteStream::count_object2 ++; - } - else - { - if(mem_allocation == true) - { - ByteStream::count_object --; - ByteStream::count_object2 ++; - } - } - mem_allocation = allocated; - } + mem_allocation = allocated; } - - void PacketLib::ByteStream::deleteStreamMemory() { if(!mem_allocation_constructor && mem_allocation) diff --git a/src/SDFRBlock.cpp b/src/SDFRBlock.cpp index 42945884bbdc03b99c5b7a325a23675f8bf06de2..285a1d997f2ad932db004d197cc846661a093044 100644 --- a/src/SDFRBlock.cpp +++ b/src/SDFRBlock.cpp @@ -39,7 +39,6 @@ bool SDFRBlock::loadFields(InputText& fp) throw(PacketException*) { try { - char* line; numberOfRBlocks = 1; rblockFilename = new char* [numberOfRBlocks]; numberOfBlockFixed[0] = true; @@ -56,7 +55,7 @@ bool SDFRBlock::loadFields(InputText& fp) throw(PacketException*) block[0].loadFields(fp); fp.setpos(0); /// It gets the [Identifiers] section - line = fp.getLine("[Identifiers]"); + fp.getLine("[Identifiers]"); return true; } catch(PacketExceptionIO* e)