diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index fcf2289570..9a6f1f25a2 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -217,9 +217,7 @@ AudioStreamView::playlist_modified () StreamView::playlist_modified(); - /* if the playlist is modified, make sure xfades are on top and all the regionviews are stacked - correctly. - */ + /* make sure xfades are on top and all the regionviews are stacked correctly. */ for (list::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { (*i)->get_canvas_group()->raise_to_top(); @@ -423,8 +421,8 @@ AudioStreamView::setup_rec_box () (RegionFactory::create (sources, start, 1 , "", 0, (Region::Flag)(Region::DefaultFlags | Region::DoNotSaveState), false))); region->set_position (_trackview.session().transport_frame(), this); rec_regions.push_back (region); - /* catch it if it goes away */ - region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_rec_region), region)); + + // rec regions are destroyed in setup_rec_box /* we add the region later */ } @@ -506,6 +504,9 @@ AudioStreamView::setup_rec_box () /* remove temp regions */ + for (list >::iterator i = rec_regions.begin(); i != rec_regions.end(); ++i) { + (*i)->drop_references(); + } rec_regions.clear(); // cerr << "\tclear " << rec_rects.size() << " rec rects\n"; @@ -569,9 +570,10 @@ AudioStreamView::update_rec_regions () continue; } - // FIXME boost::shared_ptr region = boost::dynamic_pointer_cast(*iter); - assert(region); + if (!region) { + continue; + } jack_nframes_t origlen = region->length(); diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index 555112e081..46ac213f7a 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -177,6 +177,8 @@ StreamView::remove_region_view (boost::shared_ptr r) } } +#if 0 +(unused) void StreamView::remove_rec_region (boost::shared_ptr r) { @@ -194,6 +196,7 @@ StreamView::remove_rec_region (boost::shared_ptr r) } } } +#endif void StreamView::undisplay_diskstream () diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 64a1ef74c1..b83c082b08 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -109,7 +109,7 @@ protected: virtual void add_region_view_internal (boost::shared_ptr, bool wait_for_waves) = 0; virtual void remove_region_view (boost::shared_ptr ); - void remove_rec_region (boost::shared_ptr); + //void remove_rec_region (boost::shared_ptr); (unused) void display_diskstream (boost::shared_ptr); virtual void undisplay_diskstream ();