crypt32: Moved ContextList freeing to store.c and get rid of ContextList.

This commit is contained in:
Jacek Caban 2013-10-17 11:10:18 +02:00 committed by Alexandre Julliard
parent bf464f81a8
commit fa37b63517
3 changed files with 15 additions and 22 deletions

View File

@ -109,15 +109,3 @@ void Context_CopyProperties(const void *to, const void *from)
assert(toProperties && fromProperties);
ContextPropertyList_Copy(toProperties, fromProperties);
}
void ContextList_Free(ContextList *list)
{
context_t *context, *next;
LIST_FOR_EACH_ENTRY_SAFE(context, next, list, context_t, u.entry)
{
TRACE("removing %p\n", context);
list_remove(&context->u.entry);
Context_Release(context);
}
}

View File

@ -433,13 +433,6 @@ void ContextPropertyList_Copy(CONTEXT_PROPERTY_LIST *to,
void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN;
/**
* Context list functions. A context list is a simple list of link contexts.
*/
typedef struct list ContextList;
void ContextList_Free(ContextList *list) DECLSPEC_HIDDEN;
extern WINECRYPT_CERTSTORE empty_store;
void init_empty_store(void) DECLSPEC_HIDDEN;

View File

@ -215,6 +215,18 @@ static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
return TRUE;
}
static void free_contexts(struct list *list)
{
context_t *context, *next;
LIST_FOR_EACH_ENTRY_SAFE(context, next, list, context_t, u.entry)
{
TRACE("freeing %p\n", context);
list_remove(&context->u.entry);
Context_Release(context);
}
}
static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert,
context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
{
@ -317,9 +329,9 @@ static DWORD MemStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags)
if(ref)
return (flags & CERT_CLOSE_STORE_CHECK_FLAG) ? CRYPT_E_PENDING_CLOSE : ERROR_SUCCESS;
ContextList_Free(&store->certs);
ContextList_Free(&store->crls);
ContextList_Free(&store->ctls);
free_contexts(&store->certs);
free_contexts(&store->crls);
free_contexts(&store->ctls);
store->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&store->cs);
CRYPT_FreeStore(&store->hdr);