From 315340fd9b7a4a7e4858f58d5cbe3bf5de398cf4 Mon Sep 17 00:00:00 2001 From: ponchio Date: Sat, 4 Dec 2004 13:24:28 +0000 Subject: [PATCH] Fixed a couple of memory leak... --- apps/nexus/vpartition.cpp | 7 +++++++ apps/nexus/vpartition.h | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/apps/nexus/vpartition.cpp b/apps/nexus/vpartition.cpp index 4d856470..50ae2d9a 100644 --- a/apps/nexus/vpartition.cpp +++ b/apps/nexus/vpartition.cpp @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2004/11/30 22:50:30 ponchio +Level 0. + ****************************************************************************/ @@ -36,6 +39,10 @@ using namespace std; using namespace vcg; using namespace nxs; +VPartition::~VPartition() { + if(bd) delete bd; +} + void VPartition::Init() { if(bd) delete bd; buffer.resize(size() * 3); diff --git a/apps/nexus/vpartition.h b/apps/nexus/vpartition.h index 4b18f5a3..22fa5530 100644 --- a/apps/nexus/vpartition.h +++ b/apps/nexus/vpartition.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2004/11/30 22:50:30 ponchio +Level 0. + ****************************************************************************/ @@ -47,6 +50,14 @@ namespace nxs { class VPartition: public std::vector { public: VPartition(): bd(NULL) {} + ~VPartition(); + private: + VPartition &operator=(const VPartition &part) { + for(unsigned int i = 0; i < part.size(); i++) + push_back(part[i]); + Init(); + } + public: void Init(); int Locate(const vcg::Point3f &p);