This makes the API nicer to use as you don't have to unref
newly allocated polygons, even after adding them to a view.
typedef struct _ChamplainPolygonPrivate ChamplainPolygonPrivate;
typedef struct {
- GObject parent;
+ GInitiallyUnowned parent;
ChamplainPolygonPrivate *priv;
} ChamplainPolygon;
typedef struct {
- GObjectClass parent_class;
+ GInitiallyUnownedClass parent_class;
} ChamplainPolygonClass;
GType champlain_polygon_get_type (void);
g_return_if_fail (CHAMPLAIN_IS_VIEW (view));
g_return_if_fail (CHAMPLAIN_IS_POLYGON (polygon));
- view->priv->polygons = g_list_append (view->priv->polygons, g_object_ref (polygon));
+ view->priv->polygons = g_list_append (view->priv->polygons, g_object_ref_sink (polygon));
g_signal_connect (polygon, "notify",
G_CALLBACK (notify_polygon_cb), view);