After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688214 - Don't use g_type_add_interface_static() dynamically
Don't use g_type_add_interface_static() dynamically
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks: 687659
 
 
Reported: 2012-11-12 23:54 UTC by Colin Walters
Modified: 2015-10-28 01:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GObject: register interfaces before creating the class (6.45 KB, patch)
2012-11-19 19:05 UTC, Giovanni Campagna
committed Details | Review

Description Colin Walters 2012-11-12 23:54:59 UTC
See https://bugzilla.gnome.org/show_bug.cgi?id=687659
Comment 1 Giovanni Campagna 2012-11-19 19:05:15 UTC
Created attachment 229395 [details] [review]
GObject: register interfaces before creating the class

Recent GType emits a warning and fails if g_type_add_interface_static()
is called on a GType that had its class referenced already, so we need
to register interfaces before even creating the JS class (as that references
the GType class)
Comment 2 Colin Walters 2012-11-19 19:36:58 UTC
Review of attachment 229395 [details] [review]:

Looks OK to me.  Please commit.

I have one comment though, which doesn't need to be addressed in this patch:

::: gi/object.c
@@ +2357,3 @@
+    g_type_add_interface_static(instance_type,
+                                interface_type,
+                                &interface_vtable);

Should we actually be using the _dynamic version and passing our plugin?
Comment 3 Giovanni Campagna 2012-11-19 22:19:55 UTC
(In reply to comment #2)
> ::: gi/object.c
> @@ +2357,3 @@
> +    g_type_add_interface_static(instance_type,
> +                                interface_type,
> +                                &interface_vtable);
> 
> Should we actually be using the _dynamic version and passing our plugin?

I don't know - what difference does it make?
Comment 4 Giovanni Campagna 2012-11-19 22:28:18 UTC
Comment on attachment 229395 [details] [review]
GObject: register interfaces before creating the class

Attachment 229395 [details] pushed as 2405137 - GObject: register interfaces before creating the class
Leaving open for the _dynamic question.
Comment 5 Cosimo Cecchi 2015-10-28 01:06:47 UTC
I assume there's nothing left to do here. Closing as FIXED. Please reopen or file a new issue if the _dynamic version should be used instead.