Changeset 460

Show
Ignore:
Timestamp:
01/08/07 18:54:36 (5 years ago)
Author:
radekk
Message:

Remove memory leakage in sweep_sounddata.c.
Remove unused sample.c from repository.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/trunk/include/sweep/sweep_selection.h

    r124 r460  
    2424sw_sel * 
    2525sel_new (sw_framecount_t start, sw_framecount_t end); 
     26 
     27void 
     28sel_free (sw_sel * sel); 
    2629 
    2730sw_sel * 
  • sweep/trunk/src/sweep_selection.c

    r124 r460  
    5050 
    5151  return sel; 
     52} 
     53 
     54void 
     55sel_free (sw_sel * sel) 
     56{ 
     57  if (!sel) 
     58        return; 
     59 
     60  g_free(sel); 
    5261} 
    5362 
  • sweep/trunk/src/sweep_sounddata.c

    r304 r460  
    100100sounddata_clear_selection (sw_sounddata * sounddata) 
    101101{ 
     102  GList * gl; 
     103  sw_sel * sel; 
     104 
     105  g_mutex_lock (sounddata->sels_mutex); 
     106 
     107  for (gl = sounddata->sels; gl; gl = gl->next){ 
     108          sel = (sw_sel*)gl->data; 
     109          sel_free(sel); 
     110  } 
     111 
    102112  g_list_free(sounddata->sels); 
    103113 
    104114  sounddata->sels = NULL; 
     115 
     116  g_mutex_unlock (sounddata->sels_mutex); 
    105117}; 
    106118 
     
    245257 
    246258  /* Clear the old selection */ 
    247   g_list_free (sounddata->sels); 
     259  sounddata_clear_selection (sounddata->sels); 
    248260 
    249261  /* Set the newly created (normalised) selection */