Re: [Vala] Idle.add lambda function with local variable



Glad to hear your example works.

The above works, it prints "3" everytime you click the button. However, when compiling, it still gives the 
error I posted about in my original post:


/media/Data/Code/Vala/valatest/lambda/main.vala.c: In function ‘main_button_clicked’:
/media/Data/Code/Vala/valatest/lambda/main.vala.c:131: warning: passing argument 4 of ‘g_idle_add_full’ 
from incompatible pointer type
/usr/include/glib-2.0/glib/gmain.h:291: note: expected ‘GDestroyNotify’ but argument is of type ‘void 
(*)(struct Block1Data *)’


I assumed I was doing something wrong when I saw this, but since the compiled program does work fine, I'm 
starting to think it's just a small bug in Vala.

Don't worry about the warning, some of the Vala constructs (notably
closures, async, dbus, delegates) lead to dozens of warnings, still the
code mostly runs.

-- 
:M:




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