summaryrefslogtreecommitdiff
path: root/navit/map.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-01-19 18:56:41 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-01-19 18:56:41 +0000
commit2d29d64f234eb731550f88b6b8007ea38d060da2 (patch)
treed82deab6a23f8cc81cc7bb1d618e465431df0991 /navit/map.c
parent55f4463abda76761be9e0fa284ad96d56916a51d (diff)
downloadnavit-2d29d64f234eb731550f88b6b8007ea38d060da2.tar.gz
Add:Core:Allow layer tag to reference layers within navit context, object handling cleanup
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5340 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map.c')
-rw-r--r--navit/map.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/navit/map.c b/navit/map.c
index 900e3da49..e64de77d9 100644
--- a/navit/map.c
+++ b/navit/map.c
@@ -58,9 +58,7 @@
* This structure holds information about a map.
*/
struct map {
- struct object_func *func; /**< Object functions */
- int refcount; /**< Reference count */
- struct attr **attrs; /**< Attributes of this map */
+ NAVIT_OBJECT
struct map_methods meth; /**< Structure with pointers to the map plugin's functions */
struct map_priv *priv; /**< Private data of the map, only known to the map plugin */
struct callback_list *attr_cbl; /**< List of callbacks that are called when attributes change */
@@ -110,7 +108,7 @@ map_new(struct attr *parent, struct attr **attrs)
m=g_new0(struct map, 1);
m->attrs=attr_list_dup(attrs);
m->func=&map_func;
- m->refcount = 1;
+ navit_object_ref((struct navit_object *)m);
m->attr_cbl=callback_list_new();
m->priv=maptype_new(&m->meth, attrs, m->attr_cbl);
if (! m->priv) {
@@ -120,14 +118,6 @@ map_new(struct attr *parent, struct attr **attrs)
return m;
}
-struct map *
-map_ref(struct map* m)
-{
- m->refcount++;
- return m;
-}
-
-
/**
* @brief Gets an attribute from a map
*
@@ -289,16 +279,6 @@ map_destroy(struct map *m)
g_free(m);
}
-void
-map_unref(struct map *m)
-{
- if(!m)
- return;
- m->refcount--;
- if (m->refcount <= 0)
- map_destroy(m);
-}
-
/**
* @brief Creates a new map rect
*
@@ -733,8 +713,8 @@ struct object_func map_func = {
(object_func_init)NULL,
(object_func_destroy)map_destroy,
(object_func_dup)NULL,
- (object_func_ref)map_ref,
- (object_func_unref)map_unref,
+ (object_func_ref)navit_object_ref,
+ (object_func_unref)navit_object_unref,
};