[cig-commits] r15448 - in short/3D/PyLith/trunk/modulesrc: faults include

brad at geodynamics.org brad at geodynamics.org
Fri Jul 10 09:15:00 PDT 2009


Author: brad
Date: 2009-07-10 09:15:00 -0700 (Fri, 10 Jul 2009)
New Revision: 15448

Modified:
   short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i
   short/3D/PyLith/trunk/modulesrc/include/chararray.i
   short/3D/PyLith/trunk/modulesrc/include/eqkinsrcarray.i
Log:
Fixed a couple small memory leaks related to array args in SWIG interface files.

Modified: short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i	2009-07-09 20:40:10 UTC (rev 15447)
+++ short/3D/PyLith/trunk/modulesrc/faults/FaultCohesiveKin.i	2009-07-10 16:15:00 UTC (rev 15448)
@@ -51,6 +51,7 @@
 		  const int numNames,
 		  EqKinSrc** sources,
 		  const int numSources);
+      %clear(const char* const* names, const int numNames);
       
       /** Initialize fault. Determine orientation and setup boundary
        * condition parameters.

Modified: short/3D/PyLith/trunk/modulesrc/include/chararray.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/include/chararray.i	2009-07-09 20:40:10 UTC (rev 15447)
+++ short/3D/PyLith/trunk/modulesrc/include/chararray.i	2009-07-10 16:15:00 UTC (rev 15448)
@@ -33,7 +33,7 @@
 } // typemap(in) const char**
 
 // This cleans up the char** array we malloc'd before the function call
-%typemap(freearg) (const char** string_list) {
+%typemap(freearg) (const char* const* string_list) {
   delete[] $1;
 }
 
@@ -62,7 +62,7 @@
 } // typemap(in) const char**
 
 // This cleans up the char** array we malloc'd before the function call
-%typemap(freearg) (const char** string_list, const int list_len) {
+%typemap(freearg) (const char* const* string_list, const int list_len) {
   delete[] $1;
 }
 

Modified: short/3D/PyLith/trunk/modulesrc/include/eqkinsrcarray.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/include/eqkinsrcarray.i	2009-07-09 20:40:10 UTC (rev 15447)
+++ short/3D/PyLith/trunk/modulesrc/include/eqkinsrcarray.i	2009-07-10 16:15:00 UTC (rev 15448)
@@ -43,7 +43,7 @@
 } // typemap(in) [List of kinematic earthquake sources.]
 
 // This cleans up the array we malloc'd before the function call
-%typemap(freearg) (pylith::faults::EqKinsrc** sources,
+%typemap(freearg) (pylith::faults::EqKinSrc** sources, 
 		   const int numSources) {
   delete[] $1;
 }



More information about the CIG-COMMITS mailing list