Plumb some ownership around.
This commit is contained in:
@ -27,10 +27,8 @@ private:
|
||||
private:
|
||||
class ShapeAndLink: public lout::object::Object {
|
||||
public:
|
||||
core::Shape *shape;
|
||||
std::unique_ptr< core::Shape > shape;
|
||||
int link;
|
||||
|
||||
~ShapeAndLink () { if (shape) delete shape; };
|
||||
};
|
||||
|
||||
std::list< std::unique_ptr< ShapeAndLink > > shapesAndLinks;
|
||||
@ -38,7 +36,7 @@ private:
|
||||
|
||||
public:
|
||||
void draw (core::View *view, core::style::Style *style, int x, int y);
|
||||
void add (core::Shape *shape, int link);
|
||||
void add (std::unique_ptr< core::Shape > shape, int link);
|
||||
void setDefaultLink (int link) { defaultLink = link; };
|
||||
int link (int x, int y);
|
||||
};
|
||||
@ -52,7 +50,7 @@ public:
|
||||
~ImageMapsList ();
|
||||
|
||||
void startNewMap (lout::object::Object *key);
|
||||
void addShapeToCurrentMap (core::Shape *shape, int link);
|
||||
void addShapeToCurrentMap( std::unique_ptr< core::Shape > shape, int link );
|
||||
void setCurrentMapDefaultLink (int link);
|
||||
void drawMap(lout::object::Object *key, core::View *view,
|
||||
core::style::Style *style, int x, int y);
|
||||
|
||||
Reference in New Issue
Block a user