[gjs] Remove the use of priv_from_js in the finalizer
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] Remove the use of priv_from_js in the finalizer
- Date: Tue, 7 May 2013 17:01:44 +0000 (UTC)
commit 7fe64a150d8568e3efc09b95b3e42a537c29b1c9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Apr 11 16:35:38 2013 -0400
Remove the use of priv_from_js in the finalizer
In debug mode, JS_InstanceOf checks to make sure that we aren't in
a GC at the current moment, so the finalizer function cannot call
do a dynamic typecheck in this case.
https://bugzilla.gnome.org/show_bug.cgi?id=697838
gi/boxed.c | 2 +-
gi/function.c | 2 +-
gi/gerror.c | 2 +-
gi/gtype.c | 2 +-
gi/interface.c | 2 +-
gi/keep-alive.c | 2 +-
gi/ns.c | 2 +-
gi/object.c | 2 +-
gi/param.c | 2 +-
gi/repo.c | 2 +-
gi/union.c | 2 +-
gjs/byteArray.c | 2 +-
gjs/importer.c | 2 +-
modules/cairo-context.c | 2 +-
14 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gi/boxed.c b/gi/boxed.c
index 839846f..9eb8d35 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -513,7 +513,7 @@ boxed_finalize(JSContext *context,
{
Boxed *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GBOXED,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gi/function.c b/gi/function.c
index 36413ba..ff34eed 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -1229,7 +1229,7 @@ function_finalize(JSContext *context,
{
Function *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GFUNCTION,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gi/gerror.c b/gi/gerror.c
index 77a1a7c..02e0df5 100644
--- a/gi/gerror.c
+++ b/gi/gerror.c
@@ -135,7 +135,7 @@ error_finalize(JSContext *context,
{
Error *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GERROR,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gi/gtype.c b/gi/gtype.c
index cdf85d2..f04ca34 100644
--- a/gi/gtype.c
+++ b/gi/gtype.c
@@ -52,7 +52,7 @@ static void
gjs_gtype_finalize(JSContext *context,
JSObject *obj)
{
- GType gtype = GPOINTER_TO_SIZE(priv_from_js(context, obj));
+ GType gtype = GPOINTER_TO_SIZE(JS_GetPrivate(obj));
/* proto doesn't have a private set */
if (G_UNLIKELY(gtype == 0))
diff --git a/gi/interface.c b/gi/interface.c
index 29cefe1..37f8100 100644
--- a/gi/interface.c
+++ b/gi/interface.c
@@ -52,7 +52,7 @@ interface_finalize(JSContext *context,
{
Interface *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL)
return;
diff --git a/gi/keep-alive.c b/gi/keep-alive.c
index 08624c6..1dada57 100644
--- a/gi/keep-alive.c
+++ b/gi/keep-alive.c
@@ -89,7 +89,7 @@ keep_alive_finalize(JSContext *context,
void *key;
void *value;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_KEEP_ALIVE,
"keep_alive finalizing, obj %p priv %p", obj, priv);
diff --git a/gi/ns.c b/gi/ns.c
index 391397f..23d0db0 100644
--- a/gi/ns.c
+++ b/gi/ns.c
@@ -134,7 +134,7 @@ ns_finalize(JSContext *context,
{
Ns *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GNAMESPACE,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gi/object.c b/gi/object.c
index b53e964..a832a2d 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -1334,7 +1334,7 @@ object_instance_finalize(JSContext *context,
{
ObjectInstance *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GOBJECT,
"finalize obj %p priv %p gtype %s gobj %p", obj, priv,
(priv && priv->gobj) ?
diff --git a/gi/param.c b/gi/param.c
index f2542c1..b58f7da 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -164,7 +164,7 @@ param_finalize(JSContext *context,
{
Param *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GPARAM,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gi/repo.c b/gi/repo.c
index 68bfed8..0bd4a75 100644
--- a/gi/repo.c
+++ b/gi/repo.c
@@ -205,7 +205,7 @@ repo_finalize(JSContext *context,
{
Repo *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GREPO,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gi/union.c b/gi/union.c
index 5d8825e..8ae46d0 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -259,7 +259,7 @@ union_finalize(JSContext *context,
{
Union *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_GBOXED,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index 4b74d97..25bebdd 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -464,7 +464,7 @@ byte_array_finalize(JSContext *context,
{
ByteArrayInstance *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL)
return; /* prototype, not instance */
diff --git a/gjs/importer.c b/gjs/importer.c
index 6ee5a0d..f24e360 100644
--- a/gjs/importer.c
+++ b/gjs/importer.c
@@ -974,7 +974,7 @@ importer_finalize(JSContext *context,
{
Importer *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
gjs_debug_lifecycle(GJS_DEBUG_IMPORTER,
"finalize, obj %p priv %p", obj, priv);
if (priv == NULL)
diff --git a/modules/cairo-context.c b/modules/cairo-context.c
index 4c0df1a..1879be2 100644
--- a/modules/cairo-context.c
+++ b/modules/cairo-context.c
@@ -309,7 +309,7 @@ gjs_cairo_context_finalize(JSContext *context,
JSObject *obj)
{
GjsCairoContext *priv;
- priv = priv_from_js(context, obj);
+ priv = JS_GetPrivate(obj);
if (priv == NULL)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]