Update of /cvsroot/plib/plib/src/ssg
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937
Modified Files:
ssg.h ssgSimpleList.cxx
Log Message:
Check ownership before delete. Fix by Mathias.
Index: ssg.h
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- ssg.h 29 Dec 2004 07:19:40 -0000 1.176
+++ ssg.h 6 Dec 2005 14:25:18 -0000 1.177
@@ -444,7 +444,8 @@
void removeAll ()
{
- delete [] list ;
+ if ( own_mem )
+ delete [] list ;
list = NULL ;
limit = total = 0 ;
}
Index: ssgSimpleList.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgSimpleList.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ssgSimpleList.cxx 25 Jan 2004 16:50:04 -0000 1.14
+++ ssgSimpleList.cxx 6 Dec 2005 14:25:18 -0000 1.15
@@ -28,11 +28,13 @@
{
ssgBase::copy_from ( src, clone_flags ) ;
- delete [] list ;
+ if ( own_mem )
+ delete [] list ;
size_of = src -> getSizeOf () ;
total = src -> getNum () ;
limit = total ;
list = new char [ limit * size_of ] ;
+ own_mem = true ;
memcpy ( list, src->raw_get ( 0 ), limit * size_of ) ;
}
|