<div dir="ltr">are you running out of GDI handles?<div><br><div class="gmail_quote">On Fri, Sep 19, 2008 at 10:31 PM, Tim Smith <span dir="ltr"><<a href="mailto:tsmith@tektone.net">tsmith@tektone.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">Does the following code crash for anyone else? My
app is unpredictably crashing with a segmentation fault, which I can sometimes
reproduce with this contrived test case.</span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> </span></font></p>
<pre><font size="2" face="Courier New"><span style="font-size:10.0pt">require 'fox16'; include Fox</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt"> </span></font></pre><pre>
<font size="2" face="Courier New"><span style="font-size:10.0pt">start = Time.now</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt">count = 0</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt">items = []</span></font></pre>
<pre><font size="2" face="Courier New"><span style="font-size:10.0pt">while true</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt"> 28125.times {|i|</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt"> items[i] = FXTableItem.new ''</span></font></pre>
<pre><font size="2" face="Courier New"><span style="font-size:10.0pt"> }</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt"> count += 1</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt"> puts "#{count}, after #{Time.now - start} seconds"</span></font></pre>
<pre><font size="2" face="Courier New"><span style="font-size:10.0pt">end</span></font></pre>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> </span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">The eventual error:</span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> </span></font></p>
<pre><font size="2" face="Courier New"><span style="font-size:10.0pt">c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:2367: [BUG] Segmentation fault</span></font></pre><pre><font size="2" face="Courier New"><span style="font-size:10.0pt">ruby 1.8.6 (2007-09-24) [i386-mswin32]</span></font></pre>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> </span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">I've had this code crash on XP and Vista
(but not Linux), often in under a minute, though not always. Does anyone
know what might be going on?</span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> </span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">Thanks for any help,</span></font></p>
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana"> </span></font></p><font color="#888888">
<p><font size="2" face="Verdana"><span style="font-size:10.0pt;font-family:Verdana">Tim Smith</span></font></p>
</font></div>
</div>
<br>_______________________________________________<br>
fxruby-users mailing list<br>
<a href="mailto:fxruby-users@rubyforge.org">fxruby-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/fxruby-users" target="_blank">http://rubyforge.org/mailman/listinfo/fxruby-users</a><br></blockquote></div><br></div></div>