void CleanupAll( IData *GS, double *ICs, double **Bds ) { int i = 0; if( Bds != NULL ) { for( i = 0; i < 2; i++ ) { if( Bds[i] != NULL ) { PyMem_Free( Bds[i] ); Bds[i] = NULL; } } PyMem_Free( Bds ); Bds = NULL; } if( ICs != NULL ) { PyMem_Free( ICs ); ICs = NULL; } if( GS != NULL ) { CleanupRunParams( GS ); CleanupExtInputs( GS ); CleanupEvents( GS ); CleanupIData( GS ); CleanupBasic( GS ); PyMem_Free(GS); GS = NULL; } }
PyObject* ClearParams( void ) { PyObject *OutObj = NULL; CleanupRunParams( gIData ); OutObj = Py_BuildValue("(i)", 1); assert(OutObj); return OutObj; }
PyObject* ClearParams( void ) { PyObject *OutObj = NULL; if( CleanupRunParams( gIData ) ) { OutObj = Py_BuildValue("(i)", 1); assert(OutObj); } else { OutObj = Py_BuildValue("(i)", 0); assert(OutObj); } return OutObj; }