From: schnorr Date: Fri, 17 Sep 2010 14:33:23 +0000 (+0000) Subject: only remove from dict if the key is there X-Git-Tag: v3_5~627 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/facae0548d7833b6d462c1177d11d7cdbb97948b?ds=sidebyside only remove from dict if the key is there details: - fix on multiple calls to TRACE_smpi_set_category(NULL) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8197 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/categories.c b/src/instr/categories.c index 74d5a60900..7487f74392 100644 --- a/src/instr/categories.c +++ b/src/instr/categories.c @@ -35,7 +35,9 @@ void __TRACE_category_unset (smx_process_t proc) { char processid[100]; snprintf (processid, 100, "%p", proc); - xbt_dict_remove (current_task_category, processid); + if (xbt_dict_get_or_null (current_task_category, processid) != NULL){ + xbt_dict_remove (current_task_category, processid); + } } void __TRACE_msg_category_set (smx_process_t proc, m_task_t task)