Re: [Vala] Is creating dbus interfaces in type modules (plugins) broken?
- From: PCMan <pcman tw gmail com>
- To: Jürg Billeter <j bitron ch>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Is creating dbus interfaces in type modules (plugins) broken?
- Date: Thu, 29 Nov 2012 17:46:54 +0800
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/
[
Date Prev][Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]