ID Cache: Fixed destructor callback calling.
[silc.git] / lib / silcapputil / silcidcache.c
index a6d8c26edeb7e4a49ad77917f76deb19c8f1e185..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);
@@ -142,9 +142,8 @@ silc_idcache_add(SilcIDCache cache, char *name, void *id, void *context)
   if (id) {
     /* See if this entry is added already to cache */
     if (silc_idcache_find_by_id_one(cache, id, NULL)) {
-      SILC_LOG_ERROR(("Attempted to add same ID twice to ID Cache, id %s",
+      SILC_LOG_DEBUG(("Attempted to add same ID twice to ID Cache, id %s",
                      silc_id_render(id, cache->id_type)));
-      SILC_ASSERT(FALSE);
       goto err;
     }
   }