Re: [Vala] Blitzen: A Vala Application Server
- From: Abderrahim KITOUNI <a kitouni gmail com>
- To: Samuel CUELLA <samuel cuella supinfo com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Blitzen: A Vala Application Server
- Date: Mon, 15 Nov 2010 11:51:57 +0100
Hello,
2010/11/15 Samuel CUELLA <samuel cuella supinfo com>:
I have noticed that widgets in Stk are using different reference counting rules
than Gtk. So you have to explicitly define the variables as class fields, else
all widgets gets destroyed.
Vala compiler always generate a g_object_unref() call just after widget
creation. That's why objects are destroyed. This problem doesn't arise when
using the plain C API. This is a known problem. It will be fixed, but I can't
tell you when.
It's just a matter of fixing the vapis so that valac knows that
ownership is transferred and so no need to unref. You only need to add
owned to the declaration : public void add (owned Stk.Widget w);
If you're generating the vapi using vala-gen-introspect/vapigen, you
need to add a "transfer-ownership" annotation (not sure about the
spelling, check other metadata) to the .metadata file.
HTH,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]