From c7a54f2c4d93d1a5bb8e16b89a2324e8e79bb9ac Mon Sep 17 00:00:00 2001 From: Robert Wruck Date: Tue, 21 Jun 2011 21:58:15 -0700 Subject: [PATCH] Fix list corruption in insert_time and fix sort(), too --- src/event_list.C | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/event_list.C b/src/event_list.C index 4c513ff..c717184 100644 --- a/src/event_list.C +++ b/src/event_list.C @@ -495,6 +495,8 @@ event_list::insert_time ( tick_t start, tick_t l ) e->timestamp( e->timestamp() + l ); } } + + sort(); } /** delete events in range and close the gap */ @@ -550,14 +552,19 @@ event_list::sort ( event *e ) void event_list::sort ( void ) { - event_list *temp = new event_list( *this ); + event_list *temp = new event_list( ); _head = temp->_head; _tail = temp->_tail; + FOR_ALL( n ) + temp->insert( n ); + temp->_head = NULL; delete temp; + + relink(); } /** move event /e/ by /o/ ticks */