From 069e1969a3c2593056ecd1221e7df8bd52ede13f Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 13 Dec 2008 21:48:04 +0200 Subject: [PATCH] ID Cache: Fixed destructor callback calling. The destructor context given to the ID cache destructor callback was wrong which caused odd crashes. --- lib/silcapputil/silcidcache.c | 4 ++-- lib/silcapputil/silcidcache.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/silcapputil/silcidcache.c b/lib/silcapputil/silcidcache.c index 831970d5..e2a7d8bb 100644 --- a/lib/silcapputil/silcidcache.c +++ b/lib/silcapputil/silcidcache.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 2000 - 2007 Pekka Riikonen + Copyright (C) 2000 - 2008 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ static void silc_idcache_destructor(SilcIDCache cache, void *app_context) { if (cache->destructor) - cache->destructor(cache, entry, cache->destructor, app_context); + cache->destructor(cache, entry, cache->context, app_context); memset(entry, 'F', sizeof(*entry)); silc_free(entry); diff --git a/lib/silcapputil/silcidcache.h b/lib/silcapputil/silcidcache.h index 7d8e1427..c3f48276 100644 --- a/lib/silcapputil/silcidcache.h +++ b/lib/silcapputil/silcidcache.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 2000 - 2007 Pekka Riikonen + Copyright (C) 2000 - 2008 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -185,7 +185,8 @@ SilcBool silc_idcache_del_by_id(SilcIDCache cache, void *id, * * SYNOPSIS * - * SilcBool silc_idcache_del_by_context(SilcIDCache cache, void *context); + * SilcBool silc_idcache_del_by_context(SilcIDCache cache, void *context, + * void *app_context); * * DESCRIPTION * -- 2.24.0