git-svn-id: http://ltt.polymtl.ca/svn@132 04897980-b3bd-0310-b5e0-8ef037075253
[lttv.git] / ltt / branches / poly / ltt / facility.c
index 1c31f0198fad625bde8703c808cbb422283f9672..13781668ad00482d16ee754ca3f5eb97286ac3df 100644 (file)
@@ -89,7 +89,7 @@ void ltt_facility_open(LttTrace * t, char * pathname)
       table_dispose(&fac->named_types);
       freeTypes(&fac->unnamed_types);
       sequence_dispose(&fac->unnamed_types);      
-      free(fac);
+      g_free(fac);
     }
     else in.error(&in,"facility token was expected");
   }
@@ -139,22 +139,28 @@ void generateFacility(LttFacility *f, facility *fac,LttChecksum checksum)
     evType->facility = f;
     evType->index = i;
 
-    field->field_pos = 0;
-    type = lookup_named_type(f,((event*)(events->array[i]))->type);
-    field->field_type = type;
-    field->offset_root = 0;
-    field->fixed_root = 1;
-    field->offset_parent = 0;
-    field->fixed_parent = 1;
-    //    field->base_address = NULL;
-    field->field_size  = 0;
-    field->field_fixed = -1;
-    field->parent = NULL;
-    field->child = NULL;
-    field->current_element = 0;
-
-    //construct field tree and type graph
-    constructTypeAndFields(f,((event*)(events->array[i]))->type,field);
+    if(((event*)(events->array[i]))->type != NULL){
+      field->field_pos = 0;
+      type = lookup_named_type(f,((event*)(events->array[i]))->type);
+      field->field_type = type;
+      field->offset_root = 0;
+      field->fixed_root = 1;
+      field->offset_parent = 0;
+      field->fixed_parent = 1;
+      //    field->base_address = NULL;
+      field->field_size  = 0;
+      field->field_fixed = -1;
+      field->parent = NULL;
+      field->child = NULL;
+      field->current_element = 0;
+
+      //construct field tree and type graph
+      constructTypeAndFields(f,((event*)(events->array[i]))->type,field);
+    }else{
+      evType->root_field = NULL;
+      sequence_pop(&(f->all_fields));
+      g_free(field);
+    }
   }  
 }
 
This page took 0.034828 seconds and 4 git commands to generate.