[Gtk-sharp-list] GeSettings status
Pablo Baena
pbaena@uol.com.ar
01 May 2003 01:41:09 +0000
--=-NunRRsceu66xKB8NZW1G
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Wed, 2003-04-30 at 22:50, Pablo Baena wrote:
> I only have a bug to solve that is making it stall (a finally block
> isn't being executed so a lock is not removed). I must track it
> because in .NET it doesn't happen.
This was the hardest to find bug of them all!!! It is a problem with the
foreach statement.
I already posted a bug report on bugzilla.
using System;
using System.Collections;
class TestF
{
public static void Main ()
{
Console.WriteLine ("Now it should display 10 'finally':");
for (int i = 0; i < 10; i++)
{
dosomething ();
}
}
public static void dosomething ()
{
try
{
IDictionary idic = Environment.GetEnvironmentVariables();
foreach (DictionaryEntry de in idic)
{
// If I let it iterate it runs the finally blocks
return;
}
}
finally
{
Console.WriteLine ("finally");
}
}
}
--
Pablo Baena <pbaena@uol.com.ar>
--=-NunRRsceu66xKB8NZW1G
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/1.1.7">
</HEAD>
<BODY>
On Wed, 2003-04-30 at 22:50, Pablo Baena wrote:
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#737373" SIZE="3"><I>I only have a bug to solve that is making it stall (a finally block isn't being executed so a lock is not removed). I must track it because in .NET it doesn't happen. </I></FONT>
</BLOCKQUOTE>
<FONT SIZE="3"><BR>
This was the hardest to find bug of them all!!! It is a problem with the foreach statement.<BR>
I already posted a bug report on bugzilla.<BR>
<BR>
<PRE>using System;
using System.Collections;
class TestF
{
public static void Main ()
{
Console.WriteLine ("Now it should display 10 'finally':");
for (int i = 0; i < 10; i++)
{
dosomething ();
}
}
public static void dosomething ()
{
try
{
IDictionary idic = Environment.GetEnvironmentVariables();
foreach (DictionaryEntry de in idic)
{
// If I let it iterate it runs the finally blocks
return;
}
}
finally
{
Console.WriteLine ("finally");
}
}
}</FONT></PRE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Pablo Baena <<A HREF="mailto:pbaena@uol.com.ar">pbaena@uol.com.ar</A>>
</TD>
</TR>
</TABLE>
<BR>
<BR>
</BODY>
</HTML>
--=-NunRRsceu66xKB8NZW1G--