Changeset 1073 for trunk/psLib/test/sysUtils/tst_psHash02.c
- Timestamp:
- Jun 23, 2004, 1:00:17 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sysUtils/tst_psHash02.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psHash02.c
r1022 r1073 19 19 } 20 20 ID; 21 static void IdFree(ID *id); 22 21 23 static ID *IdAlloc(const char *name) 22 24 { 23 25 ID *id = psAlloc(sizeof(ID)); 26 p_psMemSetDeallocator(id,(psFreeFcn)IdFree); 24 27 id->name = psStringCopy(name); 25 28 … … 31 34 imGlobal++; 32 35 psFree(id->name); 33 psFree(id);34 36 } 35 37 … … 52 54 i = 0; 53 55 while (myKeys[i] != NULL) { 54 psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]), 55 (void (*)(void *))IdFree); 56 id = IdAlloc(myData[i]); 57 psHashInsert(myHashTable, myKeys[i], id); 58 psFree(id); 56 59 i++; 57 60 } … … 78 81 79 82 // psHashFree(myHashTable, NULL); 80 ps HashFree(myHashTable, (void (*)(void *))IdFree);83 psFree(myHashTable); 81 84 82 85 memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
