[PD-cvs] externals/PDContainer/include GlobalStuff.h,1.4,1.5

Georg Holzmann grholzi at users.sourceforge.net
Wed Sep 21 13:52:51 CEST 2005


Update of /cvsroot/pure-data/externals/PDContainer/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30789

Modified Files:
	GlobalStuff.h 
Log Message:
found a memory leak ;)


Index: GlobalStuff.h
===================================================================
RCS file: /cvsroot/pure-data/externals/PDContainer/include/GlobalStuff.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GlobalStuff.h	5 May 2005 23:00:42 -0000	1.4
--- GlobalStuff.h	21 Sep 2005 11:52:49 -0000	1.5
***************
*** 77,87 ****
    }
  
    //Assignement Operator
    const Element& operator = (const Element &src)
!     {
!       length = src.length;
!       atom = (t_atom*)copybytes(src.atom, length * sizeof(t_atom));
!       return (*this);
!     }
  
    // operator== to compare the objects
--- 77,97 ----
    }
  
+   // Destructor
+   ~Element()
+   {
+     if(atom)
+       freebytes(atom, length);
+   }
+ 
    //Assignement Operator
    const Element& operator = (const Element &src)
!   {
!     if(atom)
!       freebytes(atom, length);
! 
!     length = src.length;
!     atom = (t_atom*)copybytes(src.atom, length * sizeof(t_atom));
!     return (*this);
!   }
  
    // operator== to compare the objects
***************
*** 135,139 ****
  			   key.atom[index].a_w.w_symbol->s_name) < 0); 
  	
! 	  return false;  
  	} // different length
        else
--- 145,149 ----
  			   key.atom[index].a_w.w_symbol->s_name) < 0); 
  	
! 	  return false;
  	} // different length
        else





More information about the Pd-cvs mailing list