Changeset 695

Show
Ignore:
Timestamp:
12/29/09 13:02:55 (2 years ago)
Author:
erikd
Message:

Fix a segfault caused by sample_set_progress_ready() being called from a
timeout after the sample had destroyed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/trunk/src/sweep_app.h

    r557 r695  
    259259  gchar * last_tmp_message; 
    260260  gint tmp_message_tag; 
     261  gint progress_ready_tag; 
    261262}; 
    262263 
  • sweep/trunk/src/sweep_sample.c

    r693 r695  
    180180  s->last_tmp_message = NULL; 
    181181  s->tmp_message_tag = -1; 
     182  s->progress_ready_tag = -1; 
    182183 
    183184  return s; 
     
    627628sample_destroy (sw_sample * s) 
    628629{ 
     630  sweep_timeout_remove (s->tmp_message_tag); 
     631  sweep_timeout_remove (s->progress_ready_tag); 
     632 
    629633  stop_playback (s); 
    630634 
     
    731735    rec_dialog_refresh_sample_list (); 
    732736    sample_destroy(s); 
    733        s = NULL; 
     737    s = NULL; 
    734738  } 
    735739 
     
    12231227  s->last_tmp_message = g_strdup (buf); 
    12241228 
    1225   if (s->tmp_message_tag != -1) { 
    1226     sweep_timeout_remove (s->tmp_message_tag); 
    1227   } 
    1228  
     1229  sweep_timeout_remove (s->tmp_message_tag); 
    12291230  s->tmp_message_tag = 
    12301231    sweep_timeout_add ((guint32)5000, 
    12311232                       (GtkFunction)sample_clear_tmp_message, s); 
    12321233 
    1233   sweep_timeout_add ((guint32)0, (GtkFunction)sample_set_progress_ready, s); 
     1234  sweep_timeout_remove (s->progress_ready_tag); 
     1235  s->progress_ready_tag = 
     1236    sweep_timeout_add ((guint32)0, (GtkFunction)sample_set_progress_ready, s); 
    12341237} 
    12351238