diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-01 21:50:52 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-01 21:50:52 +0000 |
| commit | 7504b21ce73f7f2d3787ab5f363b5e5acc721a23 (patch) | |
| tree | 9923f639e4c7862b40ffef2e3f21bec5b3be9f23 /src/sp-shape.cpp | |
| parent | Replaced calls to g_object_(un)ref with sp_object_(un)ref. (diff) | |
| download | inkscape-7504b21ce73f7f2d3787ab5f363b5e5acc721a23.tar.gz inkscape-7504b21ce73f7f2d3787ab5f363b5e5acc721a23.zip | |
Added experimental constructor to SPRect. Memory leaks because of non-virtual destructor.
(bzr r11608.1.66)
Diffstat (limited to 'src/sp-shape.cpp')
| -rw-r--r-- | src/sp-shape.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index 42b6ec6dd..e3c0301de 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -56,7 +56,7 @@ static void sp_shape_finalize (GObject *object); static void sp_shape_update_marker_view (SPShape *shape, Inkscape::DrawingItem *ai); -G_DEFINE_TYPE(SPShape, sp_shape, SP_TYPE_LPE_ITEM); +G_DEFINE_TYPE(SPShape, sp_shape, G_TYPE_OBJECT); /** * Initializes a SPShapeClass object. Establishes the function pointers to the class' @@ -76,12 +76,10 @@ CShape::CShape(SPShape* shape) : CLPEItem(shape) { CShape::~CShape() { } -/** - * Initializes an SPShape object. - */ -static void -sp_shape_init(SPShape *shape) -{ + +SPShape::SPShape() : SPLPEItem() { + SPShape* shape = this; + shape->cshape = new CShape(shape); shape->typeHierarchy.insert(typeid(SPShape)); @@ -99,6 +97,15 @@ sp_shape_init(SPShape *shape) shape->_curve_before_lpe = NULL; } +/** + * Initializes an SPShape object. + */ +static void +sp_shape_init(SPShape *shape) +{ + new (shape) SPShape(); +} + static void sp_shape_finalize(GObject *object) { |
