[GObjectIntrospection] Segmentation fault when trying to create ibus engine from javascript



Hello,

I'm in bit of trouble using GObjectIntrospection / javascript. I tried
to create an ibus engine. same code works in vala,python. but in
javascript seg fault.

OS: Opensuse 12.1
DE: Gnome3

"ibus-devel" package provides the /usr/share/gir-1.0/IBus-1.0.gir
required for GObjectIntrospection.

I'm tring to run the following code.
__________________________________
#!/usr/bin/env gjs
const IBus = imports.gi.IBus;


//get the ibus bus

bus = new IBus.Bus();


if(bus.is_connected()){

   var factory = new IBus.Factory({
       connection: bus.get_connection()
       });

   factory.add_engine({
       engine_name:"avro-phonetic",
       engine_type:typeof(this)
       });

  }

______________________________

It crashes on line 12, in "new IBus.Factory".

Terminal output,

(gjs:13353): GLib-GIO-CRITICAL **: g_dbus_connection_register_object:
assertion `object_path != NULL && g_variant_is_object_path
(object_path)' failed
Segmentation fault


I can't figure out where is the problem. I tried the vala test code
provided with ibus at
https://github.com/ibus/ibus/blob/master/bindings/vala/test/enchant.vala

It compiles and runs fine. In enchant.vala line 148.

var factory = new Factory(bus.get_connection());

The code for creating Factory is same that i tried in javascript.
also in python,

from gi.repository import IBus
from gi.repository import GLib
from gi.repository import GObject
IBus.init()
bus = IBus.Bus()
if bus.is_connected():
    factory = IBus.Factory.new(bus.get_connection())

This also seems to work fine, no seg fault. But in javascript it fails
everytime.
Any
help ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]