Transitioned TimelineHeaderContainer::headerBoxes from using shared_ptr

to weak_ptr
This commit is contained in:
Joel Holdsworth 2008-12-20 13:00:48 +00:00
parent 3dd30c848d
commit bc2fdc40e9
3 changed files with 6 additions and 3 deletions

View file

@ -33,6 +33,7 @@
#include <vector>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include "../common/util.hpp"
extern "C" {

View file

@ -434,7 +434,8 @@ TimelineHeaderContainer::draw_header_decoration(
lookup_timeline_track(model_track);
// Get the cached header box
ASSERT(contains(headerBoxes, timeline_track));
weak_ptr<timeline::Track> ptr(timeline_track);
ASSERT(contains(headerBoxes, ptr));
const Gdk::Rectangle &box = headerBoxes[timeline_track];
// Paint the box, if it will be visible
@ -502,7 +503,8 @@ TimelineHeaderContainer::get_expander_button_rectangle(
shared_ptr<Track> track)
{
REQUIRE(track != NULL);
ASSERT(contains(headerBoxes, track));
weak_ptr<timeline::Track> ptr(track);
ASSERT(contains(headerBoxes, ptr));
const Gdk::Rectangle &box = headerBoxes[track];
return Gdk::Rectangle(

View file

@ -276,7 +276,7 @@ private:
* need to be perpetually recalculated. This cache is regenerated by
* the layout_headers method.
**/
std::map<boost::shared_ptr<timeline::Track>, Gdk::Rectangle>
std::map<boost::weak_ptr<timeline::Track>, Gdk::Rectangle>
headerBoxes;
//----- User Interaction State -----//