[Vala] Problem with closure values reference count
- From: Moritz Bitsch <moritzbitsch googlemail com>
- To: vala-list gnome org
- Subject: [Vala] Problem with closure values reference count
- Date: Mon, 15 Nov 2010 11:23:47 +0100
Hi Everyone,
I found some strange errors related to closures.
The following code triggers it (tested with every vala version form
0.9.8 trough 0.11.2):
unowned Thread t;
void bugMe() {
string text = "bug me";
t = Thread.create(() => {
Thread.usleep((1000*1000) / 2);
stdout.printf("%s\n", text);
return null;
}, true);
}
void main() {
bugMe();
t.join();
}
This short program prints "(null)" instead of "bug me".
It seems to me that closures don't do any refcounting for their BlockData.
Is this intended or a bug?
Regards,
Moritz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]