[gjs] ns: Don't store a pointer to the repo
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] ns: Don't store a pointer to the repo
- Date: Fri, 3 Jan 2014 07:08:13 +0000 (UTC)
commit d35555a7aa0bdcecce99f7c3594006637cca9283
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jan 2 15:23:51 2014 -0500
ns: Don't store a pointer to the repo
It's unused
gi/ns.cpp | 14 +++-----------
gi/ns.h | 3 +--
gi/repo.cpp | 2 +-
3 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/gi/ns.cpp b/gi/ns.cpp
index c7ad03e..f3d116b 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -35,9 +35,7 @@
#include <string.h>
typedef struct {
- GIRepository *repo;
char *gi_namespace;
-
} Ns;
extern struct JSClass gjs_ns_class;
@@ -142,8 +140,6 @@ ns_finalize(JSFreeOp *fop,
if (priv->gi_namespace)
g_free(priv->gi_namespace);
- if (priv->repo)
- g_object_unref(priv->repo);
GJS_DEC_COUNTER(ns);
g_slice_free(Ns, priv);
@@ -178,8 +174,7 @@ JSFunctionSpec gjs_ns_proto_funcs[] = {
static JSObject*
ns_new(JSContext *context,
- const char *ns_name,
- GIRepository *repo)
+ const char *ns_name)
{
JSObject *ns;
JSObject *global;
@@ -236,16 +231,13 @@ ns_new(JSContext *context,
gjs_debug_lifecycle(GJS_DEBUG_GNAMESPACE, "ns constructor, obj %p priv %p", ns, priv);
priv = priv_from_js(context, ns);
- priv->repo = (GIRepository*) g_object_ref(repo);
priv->gi_namespace = g_strdup(ns_name);
-
return ns;
}
JSObject*
gjs_create_ns(JSContext *context,
- const char *ns_name,
- GIRepository *repo)
+ const char *ns_name)
{
- return ns_new(context, ns_name, repo);
+ return ns_new(context, ns_name);
}
diff --git a/gi/ns.h b/gi/ns.h
index 4f8b45e..c6a1b89 100644
--- a/gi/ns.h
+++ b/gi/ns.h
@@ -31,8 +31,7 @@
G_BEGIN_DECLS
JSObject* gjs_create_ns(JSContext *context,
- const char *ns_name,
- GIRepository *repo);
+ const char *ns_name);
G_END_DECLS
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 61d3a8a..95ed577 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -125,7 +125,7 @@ resolve_namespace_object(JSContext *context,
* with the given namespace name, pointing to that namespace
* in the repo.
*/
- gi_namespace = gjs_create_ns(context, ns_name, repo);
+ gi_namespace = gjs_create_ns(context, ns_name);
JS_AddObjectRoot(context, &gi_namespace);
/* Define the property early, to avoid reentrancy issues if
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]