summaryrefslogtreecommitdiff
path: root/navit/mapset.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/mapset.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/mapset.c')
-rw-r--r--navit/mapset.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/navit/mapset.c b/navit/mapset.c
index 9748f88d4..df4fcfb00 100644
--- a/navit/mapset.c
+++ b/navit/mapset.c
@@ -42,9 +42,7 @@
* This structure holds a complete mapset
*/
struct mapset {
- struct object_func *func;
- int refcount;
- struct attr **attrs;
+ NAVIT_OBJECT
GList *maps; /**< Linked list of all the maps in the mapset */
};
@@ -63,7 +61,7 @@ struct mapset *mapset_new(struct attr *parent, struct attr **attrs)
ms=g_new0(struct mapset, 1);
ms->func=&mapset_func;
- ms->refcount=1;
+ navit_object_ref((struct navit_object *)ms);
ms->attrs=attr_list_dup(attrs);
return ms;
@@ -160,22 +158,6 @@ void mapset_destroy(struct mapset *ms)
g_free(ms);
}
-struct mapset *
-mapset_ref(struct mapset* m)
-{
- m->refcount++;
- return m;
-}
-
-
-void
-mapset_unref(struct mapset *m)
-{
- m->refcount--;
- if (m->refcount <= 0)
- mapset_destroy(m);
-}
-
/**
* @brief Handle for a mapset in use
*
@@ -410,8 +392,8 @@ struct object_func mapset_func = {
(object_func_init)NULL,
(object_func_destroy)mapset_destroy,
(object_func_dup)mapset_dup,
- (object_func_ref)mapset_ref,
- (object_func_unref)mapset_unref,
+ (object_func_ref)navit_object_ref,
+ (object_func_unref)navit_object_unref,
};