Пример #1
0
CProtocolKey::~CProtocolKey()
/**
* Destructor.
*/
{
    // release End Points recorded by SetOpt
    for (TInt i = iEndPoints.Count(); --i >= 0; )
    {
        iEndPoints[i].Close();
    }
    iEndPoints.Close();

    delete iCrypto;		// Relese crypto libraries
    delete iTimer;		// Disconnect Timer system.
    //
    // Release Security Associations
    //
    for (TInt j = 0; j < HashSize(); ++j)
        while (iHash[j])
        {
            CSecurityAssoc *sa = iHash[j];
            iHash[j] = sa->iNext;
            delete sa;
        }
    // If assumptions are correct, iSAPlist should be empty!!
    ASSERT(iSAPlist.IsEmpty());
#if __WINS__
    LOG(Log::Printf(_L("CProtocolKey::~CProtocolKey() done IPSEC_OBJECT_COUNT=%d"), IPSEC_OBJECT_COUNT));
#endif
}
Пример #2
0
int NMultiFreeData(MULTI *ma) {
  ARRAY *a;
  int i, n;

  if (!ma) return 0;
  
  n = HashSize(ma->ndim);
  for (i = 0; i < n; i++) {
    a = &(ma->array[i]);
    NMultiFreeDataOnly(a);
  }
  return 0;
}
Пример #3
0
int NMultiInit(MULTI *ma, int esize, int ndim, int *block,
    ARRAY_ELEM_FREE FreeElem, ARRAY_DATA_INIT InitData) {
  int i, n;

  ma->maxelem = -1;
  ma->numelem = 0;
  ma->ndim = ndim;
  ma->isize = sizeof(int)*ndim;
  ma->esize = esize;
  ma->block = (unsigned short *) malloc(sizeof(unsigned short)*ndim);
  n = HashSize(ma->ndim);

  ma->array = (ARRAY *) malloc(sizeof(ARRAY)*n);
  for (i = 0; i < n; i++) {
    ArrayInit(&(ma->array[i]), sizeof(MDATA), 10, FreeElem, InitData);
  }

  return 0;
}