filter fix
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 25 Jul 2005 20:41:14 +0000 (20:41 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 25 Jul 2005 20:41:14 +0000 (20:41 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@973 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/filter.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c

index 11358657f02e16d9b324ede06c8cb8484a813581..daa00769234964c14c9226f8764d1b46af5d75fd 100644 (file)
@@ -1042,7 +1042,9 @@ lttv_filter_tree_clone(const LttvFilterTree* tree) {
  */
 LttvFilter*
 lttv_filter_clone(const LttvFilter* filter) {
-    
+       if(!filter) return NULL;
+
   LttvFilter* newfilter = g_new(LttvFilter,1); 
 
   strcpy(newfilter->expression,filter->expression);
@@ -1486,8 +1488,12 @@ lttv_filter_update(LttvFilter* filter) {
 void
 lttv_filter_destroy(LttvFilter* filter) {
   
-  g_free(filter->expression);
-  lttv_filter_tree_destroy(filter->head);
+       if(!filter) return;
+
+       if(filter->expression)
+         g_free(filter->expression);
+       if(filter->head)
+         lttv_filter_tree_destroy(filter->head);
   g_free(filter);
   
 }
index d30a490da2399f450e6b683dd00f1ff957011a30..5ded4686fff86ea56aedec51c7b3d73439f823fa 100644 (file)
@@ -4122,10 +4122,7 @@ Tab* create_tab(MainWindow * mw, Tab *copy_tab,
     /* Copy the previous tab's filter */
     /* We can clone the filter, as we copy the trace set also */
     /* The filter must always be in sync with the trace set */
-               if(copy_tab->filter != NULL)
-           tab->filter = lttv_filter_clone(copy_tab->filter);
-               else
-                       tab->filter = NULL;
+    tab->filter = lttv_filter_clone(copy_tab->filter);
 
   } else {
     tab->traceset_info->traceset = lttv_traceset_new();
This page took 0.027034 seconds and 4 git commands to generate.