Possible crash fixed.

git-svn: trunk@22
This commit is contained in:
Tomasz Kojm 2003-08-30 19:20:04 +00:00
parent 049a18b966
commit 0ae75a8d66
2 changed files with 93 additions and 47 deletions

View file

@ -44,6 +44,7 @@ blobCreate(void)
#ifdef CL_DEBUG
blob *b = (blob *)cli_calloc(1, sizeof(blob));
b->magic = BLOB;
cli_dbgmsg("blobCreate\n");
return b;
#else
return (blob *)cli_calloc(1, sizeof(blob));
@ -53,6 +54,12 @@ blobCreate(void)
void
blobDestroy(blob *b)
{
#ifdef CL_DEBUG
cli_dbgmsg("blobDestroy %d\n", b->magic);
#else
cli_dbgmsg("blobDestroy\n");
#endif
assert(b != NULL);
assert(b->magic == BLOB);
@ -69,8 +76,13 @@ blobDestroy(blob *b)
void
blobArrayDestroy(blob *blobList[], int n)
{
while(--n >= 0)
blobDestroy(blobList[n]);
while(--n >= 0) {
cli_dbgmsg("blobArrayDestroy: %d\n", n);
if(blobList[n]) {
blobDestroy(blobList[n]);
blobList[n] = NULL;
}
}
}
void