Hi Wendell

Having just stared at some of my code for a little while, I think this might 
be a bug on my part!  Basically there is a memory leak of cloned windows for 
each button.  These are released in any case when the dialog is disposed, but 
if you re-initialized lots of buttons in the way you are doing, then you 
could run out of resources whilst the window was still open - possibly this 
happens sooner on windows than linux.

Anyway, the fix is very simple and I'll put it in CVS (gui/component.icn).  
I'll send you a copy of the file.

One other thing - I'd change the code in your loop to the following, which is 
a bit better, because attribs set via set_attribs actually accumulate in a 
list
       button[index].attribs := [ "bg=" || color, "fg=black" ]
       button[index].finally()
       button[index].init()
       button[index].invalidate()


On Tuesday 05 September 2006 17:52, Wendell Turner wrote:
> I'm having trouble porting a working gui/modal program from
> Linux to Windows.  It runs fine on Linux, and runs for a while
> on Windows, but ends up with the following error:
>
>    gui__center_string(&null,105,57,"N40",&null) from line 43 in
> textbutton.icn TextWidth(&null,"N40") from line 205 in guiprocs.icn
>
> It seems to occur in the following loop:
>
>   while *(q := select(udp_port,2)) > 0 do
>     every f := !q do
>     {
>       r := receive(f)
>       ...
>       button[index].attrib( "bg=" || color, "fg=black" )
>       button[index].set_attribs( "bg=" || color, "fg=black" )
>       button[index].finally()
>       button[index].init()
>       button[index].resize()
>     }
>
> When several udp msgs are received together, requiring several
> buttons to change color, after the loop exits (and processing
> goes back to the modal event loop?), the error occurs.  When one
> message is received (alone), and only one button changes color,
> it seems to work fine.
>
> (I'm not sure about the finally, init, or resize, but calling
> them makes the button color take effect.)
>
> Full error text is at http://www.halcyon.com/wturner/windows_error_msg.txt
>
> Any suggestions?
>
> Wendell
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to