Exemple #1
0
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;
 }
}
Exemple #2
0
PyObject* ClearParams( void ) {
  PyObject *OutObj = NULL;
  CleanupRunParams( gIData );
  OutObj = Py_BuildValue("(i)", 1);
  assert(OutObj);
  return OutObj;
}
Exemple #3
0
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;

}