[Vala] Asynchronous construction

2012-03-27 Thread tomw
Hi, trying to make the gfreenect [1] library work with Vala and in particular to deal with the missing asynchronous constructor support I was running into some issues. The vapi [2] is generated from GIR. The corresponding code in C is pretty straight forward and would look like this: static

Re: [Vala] Asynchronous construction

2012-03-27 Thread Jens Georg
Hi, [Freenect C init sample ] Trying to implement that in Vala, I took the approach below. It seems however, that the init_async does not work. Looking at the generated C-Code it looks like the g_async_initable_init_finish method is called right after init_async an not with in the

Re: [Vala] Asynchronous construction

2012-03-27 Thread tomw
On Di, 2012-03-27 at 11:59 +0200, Jens Georg wrote: try { debug (Trying to run init_async); bool re = yield device.init_async (Priority.DEFAULT, cancellable); ^^ this yield returns to main loop and once init_async calls its call-back will call

Re: [Vala] Asynchronous construction

2012-03-27 Thread Jens Georg
On Di, 2012-03-27 at 12:24 +0200, tomw wrote: On Di, 2012-03-27 at 11:59 +0200, Jens Georg wrote: try { debug (Trying to run init_async); bool re = yield device.init_async (Priority.DEFAULT, cancellable); ^^ this yield returns to main loop and once

Re: [Vala] Asynchronous construction

2012-03-27 Thread tomw
gfreenect_device_new_finished is just calling _async_initable_new_finish which calls async_initable_finish, same for _device_new. Removing the subdevices property stops the crashing here. looking at the gfreenect code that isn't used at all: