Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Always free cat->layout on xbt_log_layout_set.
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 27 Jan 2011 10:51:55 +0000 (10:51 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 27 Jan 2011 10:51:55 +0000 (10:51 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9513 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/log.c

index d00f860..b4e3010 100644 (file)
@@ -1060,13 +1060,11 @@ void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
          cat->name);
     xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL));
   }
-  if (cat->layout && cat != &_XBT_LOGV(root)) {
-    /* better leak the default layout than check every categories to
-       change it */
+  if (cat->layout) {
     if (cat->layout->free_) {
       cat->layout->free_(cat->layout);
-      free(cat->layout);
     }
+    free(cat->layout);
   }
   cat->layout = lay;
   xbt_log_additivity_set(cat, 0);