Hi,

This works with Vala 0.10.4:

        $ cat test.vala 
        void main(){
                X.Display disp = new X.Display();
                stdout.printf("%s\n", disp.display_string());
        }
        $ valac --pkg=x11 test.vala && ./test 
        :0.0 
        $

This doesn't work with Vala 0.10.4:

        $ cat test.vala 
        void main(){
                X.Display disp = new X.Display();
                stdout.printf("%s\n", disp.display_string());
                stdout.printf("%s\n", disp.display_string());
        }
        $ valac --pkg=x11 test.vala && ./test 
        :0.0

        *** glibc detected *** ./test: double free or corruption (fasttop): 
0x08509958 ***
        [...]

The attached patch fixes the issue for me. Please include it in master
if you have no objections.

Best regards

Alexander Kurtz
diff -Naur a/x11.vapi b/x11.vapi
--- a/x11.vapi	2011-04-04 22:49:53.000000000 +0200
+++ b/x11.vapi	2011-04-04 20:13:27.000000000 +0200
@@ -76,7 +76,7 @@
 		public unowned Screen screen_by_id (int screen_number);
 
 		[CCode (cname = "DisplayString")]
-		public string display_string ();
+		public unowned string display_string ();
 
 		[CCode (cname = "XQLength")]
 		public int event_queue_length ();

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to