Re: [Vala] Problem with GLib.KeyFile
- From: JM <interflug1 gmx net>
- To: vala-list gnome org
- Subject: Re: [Vala] Problem with GLib.KeyFile
- Date: Thu, 21 Feb 2013 18:33:34 +0100
Do this:
public unowned GLib.KeyFile get_key_file() {
return key_file;
}
That should work
Am Donnerstag, den 21.02.2013, 13:36 +0100 schrieb Robin Krahl:
Hi there,
I try to use GLib.KeyFile to parse a configuration file yet I am experiencing
problems even if I just return a reference to a KeyFile object (see code and
output below). What am I doing wrong?
Thanks in advance for your help!
Regards,
Robin
== Minimal code example
class Test {
private GLib.KeyFile key_file = new GLib.KeyFile();
public GLib.KeyFile get_key_file() {
return key_file;
}
static int main(string[] args) {
Test test = new Test();
test.get_key_file();
return 0;
}
}
== Compiler output
$ valac test.vala
test.vala:6.16-6.23: error: duplicating KeyFile instance, use unowned variable
or explicitly invoke copy method
return key_file;
^^^^^^^^
** (valac:18290): CRITICAL **: vala_ccode_function_add_assignment: assertion
`right != NULL' failed
Compilation failed: 1 error(s), 0 warning(s)
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]