diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index db8bcd614..5b3e73faa 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -42,19 +42,17 @@ TimelineWidget::TimelineWidget() : verticalScroll(verticalAdjustment), ruler("ruler") { - TimelineBody *body_ptr = new TimelineBody(this); - body = Glib::RefPtr(body_ptr); - g_assert(body); - HeaderContainer *header_container_ptr = new HeaderContainer(this); - headerContainer = Glib::RefPtr(header_container_ptr); - g_assert(headerContainer); + body = new TimelineBody(this); + g_assert(body != NULL); + headerContainer = new HeaderContainer(this); + g_assert(headerContainer != NULL); verticalAdjustment.signal_value_changed().connect( sigc::mem_fun(this, &TimelineWidget::on_scroll) ); - attach(*body_ptr, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); + attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); - attach(*header_container_ptr, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(*headerContainer, 0, 1, 1, 2, SHRINK, FILL|EXPAND); attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); @@ -66,7 +64,10 @@ TimelineWidget::TimelineWidget() : TimelineWidget::~TimelineWidget() { - + g_assert(body != NULL); + body->unreference(); + g_assert(headerContainer != NULL); + headerContainer->unreference(); } void @@ -86,7 +87,7 @@ TimelineWidget::on_size_allocate(Allocation& allocation) void TimelineWidget::update_tracks() { - g_assert(headerContainer); + g_assert(headerContainer != NULL); headerContainer->update_headers(); // Recalculate the total height of the timeline scrolled area @@ -103,7 +104,7 @@ TimelineWidget::update_tracks() void TimelineWidget::update_scroll() { - g_assert(body); + g_assert(body != NULL); const Allocation body_allocation = body->get_allocation(); // Calculate the length that can be scrolled: diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index cd752060a..502b3c535 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -67,8 +67,8 @@ class TimelineWidget : public Gtk::Table timeline::VideoTrack video2; std::vector tracks; - Glib::RefPtr body; - Glib::RefPtr headerContainer; + timeline::TimelineBody *body; + timeline::HeaderContainer *headerContainer; Gtk::Label ruler; Gtk::Adjustment horizontalAdjustment, verticalAdjustment;