Re: possible win32lib bug

new topic     » goto parent     » topic index » view thread      » older message » newer message

While writing a little note to point you to the problem I was mindlessly staring at the screen when an epiphany happened! Dangerous things those epiphanies. View the following code:

procedure pw_print_btn_onClick (integer self, integer event, sequence params) 
if not printer_setup () then 
	closeApp () 
	puts(1, "#1 after close app line 474\n") 
end if 
puts(1, "#2 after close app line 475\n") 
if equal(log_to_print,"docent") then 

line 474 [closeApp]: Supposedly, win32lib procedure closeApp() releases any system resources and closes down the application. It does do this in most cases; however, here it seems this does not happen. It's a race to the finish and win32lib loses! I think what happens here is line 474 is executed but euphoria doesn't wait until it is finished before executing line 475. Now Euphoria is a procedural language. It executes code one line at a time. In the above example Euphoria will happy continue executing statements after line 474 until a crash occurs or win32lib finally gets around to closing the application. If you insert an abort (0) between 474 and 475 all it good.

This bothersome on several levels. When one calls a procedure one expects it to be completely executed to the "end procedure" statement before returning control to the calling routine.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu