IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2005, 1:44:22 PM (21 years ago)
Author:
desonia
Message:

added enhancement to psFree so that it sets the reference being freed to
NULL (thanks Gus).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/tst_psArray.c

    r3682 r4308  
    1717 *  @author  Ross Harman, MHPCC
    1818 *
    19  *  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2005-04-07 20:27:41 $
     19 *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
     20 *  @date  $Date: 2005-06-17 23:44:22 $
    2121 *
    2222 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    202202        }
    203203    }
    204     psFree(mySt[0]);
     204    psMemDecrRefCounter(mySt[0]);
    205205    printFooter(stderr,"psArray","Remove valid item", true);
    206206
     
    235235        psFree(mySt[i]);
    236236    }
    237     if( psMemCheckLeaks(0, NULL, stderr, false) != 0) {
    238         psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
    239         return 110;
    240     }
    241     psS32 nBad = psMemCheckCorruption(0);
    242     if(nBad) {
    243         fprintf(stderr,"ERROR: Found %d bad memory blocks\n", nBad);
    244         return 111;
    245     }
     237
    246238    printFooter(stderr, "psArray" ,"Free void pointer array", true);
    247239
     
    361353        }
    362354
    363         psFree(data);
    364 
    365355        subtest++;
    366356        if (arr->nalloc != nalloc) {
     
    386376            return subtest;
    387377        }
     378
     379        psFree(data);
    388380    }
    389381
     
    391383    data = psAlloc(sizeof(float));
    392384    arr = psArrayAdd(arr, delta, data);
    393     psFree(data);
    394385
    395386    // make sure the array was expanded
     
    418409    }
    419410
     411    psFree(data);
     412
    420413    // make the array full again (operation tested already)
    421414    while (arr->n < arr->nalloc) {
Note: See TracChangeset for help on using the changeset viewer.