[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28445] branches/nurbs25/intern/nurbana/ intern: Typo memory leak, fixed up some other stuff too

Emmanuel Stone emmanuel.stone at gmail.com
Tue Apr 27 00:41:20 CEST 2010


Revision: 28445
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28445
Author:   eman
Date:     2010-04-27 00:41:20 +0200 (Tue, 27 Apr 2010)

Log Message:
-----------
Typo memory leak, fixed up some other stuff too

Modified Paths:
--------------
    branches/nurbs25/intern/nurbana/intern/nbNURBS.cpp
    branches/nurbs25/intern/nurbana/intern/nbTessellator.h

Modified: branches/nurbs25/intern/nurbana/intern/nbNURBS.cpp
===================================================================
--- branches/nurbs25/intern/nurbana/intern/nbNURBS.cpp	2010-04-26 21:28:50 UTC (rev 28444)
+++ branches/nurbs25/intern/nurbana/intern/nbNURBS.cpp	2010-04-26 22:41:20 UTC (rev 28445)
@@ -112,14 +112,21 @@
 }
 
 nbNURBS::~nbNURBS() {
-	/*  if(m_sum)
-	MEM_freeN(m_sum);
+	 if(m_sum)
+		MEM_freeN(m_sum);
+	m_sum = NULL;
 	if(m_sumIPC[0])
-	MEM_freeN(m_sumIPC[0]);
+		MEM_freeN(m_sumIPC[0]);
+	m_sumIPC[0] = NULL;
 	if(m_sumIPC[1])
-	MEM_freeN(m_sumIPC[1]);
+		MEM_freeN(m_sumIPC[1]);
+	m_sumIPC[1] = NULL;
 	if(m_oldBuffer)
-	MEM_freeN(m_oldBuffer);*/
+		MEM_freeN(m_oldBuffer);
+	m_oldBuffer = NULL;
+	if(m_ctlPtsOld)
+		MEM_freeN(m_ctlPtsOld);
+	m_ctlPtsOld = NULL;
 	//  if(_Normals)
 	//	  MEM_freeN(_Normals);
 } //eof nbNURBS::~nbNURBS()
@@ -183,7 +190,7 @@
 	m_sum = (nbReal*)MEM_callocN(sizeof(nbReal)*len*4,"m_sum realloc");
 
 	//len = tessU * tessV;
-	m_sum = (nbReal*)MEM_callocN(sizeof(nbReal)*tessU * tessV,"m_sum realloc");
+	//m_sum = (nbReal*)MEM_callocN(sizeof(nbReal)*tessU * tessV,"m_sum realloc");
 
 	//_Change[0] = 1;
 }

Modified: branches/nurbs25/intern/nurbana/intern/nbTessellator.h
===================================================================
--- branches/nurbs25/intern/nurbana/intern/nbTessellator.h	2010-04-26 21:28:50 UTC (rev 28444)
+++ branches/nurbs25/intern/nurbana/intern/nbTessellator.h	2010-04-26 22:41:20 UTC (rev 28445)
@@ -24,11 +24,11 @@
 	virtual void getNormals(const int* qIndexes, const int* tIndexes, const nbReal* verts, nbReal* nors);
 	virtual void update() {};
 
-#ifdef WITH_CXX_GUARDEDALLOC
-	public:
-		void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
-		void operator delete( void *mem ) { MEM_freeN(mem); }
-#endif
+//#ifdef WITH_CXX_GUARDEDALLOC
+//	public:
+//		void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
+//		void operator delete( void *mem ) { MEM_freeN(mem); }
+//#endif
 
 };
 





More information about the Bf-blender-cvs mailing list