ID Cache: Fixed destructor callback calling.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 13 Dec 2008 19:48:04 +0000 (21:48 +0200)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 13 Dec 2008 19:48:04 +0000 (21:48 +0200)
The destructor context given to the ID cache destructor callback was wrong
which caused odd crashes.

lib/silcapputil/silcidcache.c
lib/silcapputil/silcidcache.h

index 831970d5dd940e3b298795f8863e2fbbe91b396a..e2a7d8bb874bc70d69f0cc58b4843079697d29ac 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  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);
index 7d8e1427abfa2219e9b041185b6f475f6f6d3cba..c3f48276e10fbd14395bbba33ce5a30390b0b0f2 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  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
  *