Re: [Vala] Is creating dbus interfaces in type modules (plugins) broken?

2012-11-29 Thread JM
Hello
Unfortunately you didn't point to the exact code lines but I had the
same issue.
I experienced the same thing with an interface for
org.gnome.SettingsDaemon.MediaKeys. I got crashes if the interface
declaration was in the module. Moving the interface to the application
itself fixed the issue. But the implementation of the interface may
remain in the module and it is working.
Regards 


Am Donnerstag, den 29.11.2012, 10:06 +0800 schrieb PCMan:
 Hello,
 I tried to develop some type modules for my program.
 Everything works fine initially and [ModuleInit] registered GObject dynamic
 classes automagically as expected.
 However, after I move a previously working dbus interface to that type
 module, I got crashes.
 
 My source code is here:
 http://lxde.git.sourceforge.net/git/gitweb.cgi?p=lxde/lxpanel2;a=summary
 
 A google search lead me to a similar report from others:
 https://mail.gnome.org/archives/vala-list/2012-September/msg00125.html
 
 Is this a known bug? Or is there anyway to overcome this?
 I like vala a lot and I don't want to rewrite the whole program in C again
 just because some little problems.
 
 Thanks in advance.
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Is creating dbus interfaces in type modules (plugins) broken?

2012-11-29 Thread Jürg Billeter
On Thu, 2012-11-29 at 10:06 +0800, PCMan wrote:
 I tried to develop some type modules for my program.
 Everything works fine initially and [ModuleInit] registered GObject dynamic
 classes automagically as expected.
 However, after I move a previously working dbus interface to that type
 module, I got crashes.

Support for dynamic types will likely be removed from a future GLib
version¹, i.e., you will no longer be able to unload modules. Can you
try whether you can fix the crashes by simply removing the [ModuleInit]
attribute? Module loading should still work the same way, you just won't
be able to unload it without restarting the process.

If you want to keep using dynamic types and help finding the solution
for this bug, can you please try the following?
  * Replace G_DEFINE_TYPE_EXTENDED in the generated .c file by
G_DEFINE_DYNAMIC_TYPE_EXTENDED (for the UPower proxy)
  * Add upower_upower_proxy_register_type(type_module) to your
plugin_init function right after the call to
upower_upower_register_type

Regards,
Jürg

¹ http://blogs.gnome.org/mclasen/2012/10/08/gnome-summit-sunday/

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Is creating dbus interfaces in type modules (plugins) broken?

2012-11-29 Thread PCMan
Thank you for the info.
I'll remove dynamic type modules from my program.
It's a pity that the feature is going to be removed.
I think it's a wrong decision.
Without this features, we cannot unload large and unused modules and
its dependencies to save resources once it's no longer needed.
In C++, it's perfectly legal to unload a lib at runtime.
In C/GObject, it's no longer possible. This is the price we pay for
fake OOP support in C.
Really disappointed to hear that news.
Thanks anyway.

On Thu, Nov 29, 2012 at 5:39 PM, Jürg Billeter j...@bitron.ch wrote:
 On Thu, 2012-11-29 at 10:06 +0800, PCMan wrote:
 I tried to develop some type modules for my program.
 Everything works fine initially and [ModuleInit] registered GObject dynamic
 classes automagically as expected.
 However, after I move a previously working dbus interface to that type
 module, I got crashes.

 Support for dynamic types will likely be removed from a future GLib
 version¹, i.e., you will no longer be able to unload modules. Can you
 try whether you can fix the crashes by simply removing the [ModuleInit]
 attribute? Module loading should still work the same way, you just won't
 be able to unload it without restarting the process.

 If you want to keep using dynamic types and help finding the solution
 for this bug, can you please try the following?
   * Replace G_DEFINE_TYPE_EXTENDED in the generated .c file by
 G_DEFINE_DYNAMIC_TYPE_EXTENDED (for the UPower proxy)
   * Add upower_upower_proxy_register_type(type_module) to your
 plugin_init function right after the call to
 upower_upower_register_type

 Regards,
 Jürg

 ¹ http://blogs.gnome.org/mclasen/2012/10/08/gnome-summit-sunday/

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list