hotfix for flying percussive hits while dragging.
[ardour.git] / gtk2_ardour / automation_region_view.cc
index 8466292975eff616606aef2b384547401cc12652..e3e41b442801028c6eb47aefc01709749e747c52 100644 (file)
@@ -68,6 +68,7 @@ AutomationRegionView::AutomationRegionView (ArdourCanvas::Container*
 
 AutomationRegionView::~AutomationRegionView ()
 {
+       in_destructor = true;
        RegionViewGoingAway (this); /* EMIT_SIGNAL */
 }
 
@@ -182,7 +183,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double
 
        /* snap frame */
 
-       when = snap_frame_to_frame (when - _region->start ()) + _region->start ();
+       when = snap_frame_to_frame (when - _region->start ()).frame + _region->start ();
 
        /* map using line */