Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
only remove from dict if the key is there
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 17 Sep 2010 14:33:23 +0000 (14:33 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 17 Sep 2010 14:33:23 +0000 (14:33 +0000)
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

src/instr/categories.c

index 74d5a60..7487f74 100644 (file)
@@ -35,7 +35,9 @@ void __TRACE_category_unset (smx_process_t proc)
 {
   char processid[100];
   snprintf (processid, 100, "%p", 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)
 }
 
 void __TRACE_msg_category_set (smx_process_t proc, m_task_t task)