From: SourceForge.net <no...@so...> - 2006-05-05 21:04:32
|
Bugs item #1481986, was opened at 2006-05-04 09:57 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1481986&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 49. Embedding Support Group: obsolete: 8.4.9 Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Don Porter (dgp) Summary: Tcl_Main blocks before starting my loop in Tcl_SetMainLoop Initial Comment: From: ali...@sb... (Andrew Lin) After some discussion, DonP thinks it is necessary to patch this misfeature. A quick patch will be appreciated. OS: Redhat Fedora 4 Problem: I use Tcl_SetMainLoop to setup myEventLoop for Qt window. However, Tcl_Main first blocks at tcl prompt "%" instead of starting myEventLoop until I hit RETURN, then myEventLoop starts properly while tcl prompt continues to accept command. Expected: Tcl_Main should enter interactive mode and run myEventLoop without waiting for RETURN at tcl prompt. Sample: Tcl_SetMainLoop(myEventLoop); Tcl_Main(1, argv, Tcl_AppInit); ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-05-05 14:04 Message: Logged In: NO Yes the new patch is good! After I rebuilt my application, Tcl_Main starts myEventLoop properly while giving me the interactive tcl prompt as expected. Thank you for fixing this problem so quickly, will wait for patch in 8.4.14 release. Thanks, Andrew (ali...@sb...) ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-05-05 11:10 Message: Logged In: YES user_id=80530 fix committed for 8.4.14 and 8.5a5 ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-05-05 11:06 Message: Logged In: YES user_id=80530 Somehow you're not testing the patched version. If you use the patched version, you should not reach Tcl_GetObj() (line 354) because the (mainLoopProc == NULL) test on line 338 should be false and send control on to line 415. Re-check your testing, or use the test suite case in the more recent patch to verify the bug fix. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-05-05 10:58 Message: Logged In: NO Thanks Don, I downloaded 1481986.patch against 8.4.13 but it still had the same blocking problem. Then I traced down to Tcl_GetsObj() is actually blocking for RETURN in Tcl_Main, so I added "if (mainLoopProc == NULL)" to skip that code segment when Tcl_SetMainLoop is used. With this change, now Tcl_Main starts myEventLoop properly while giving me the interactive tcl prompt. Do you expect any side-effect from this change in tclMain.c? 352a353,354 > // 2006.5.5 alin Do not block if mainLoopProc set > if (mainLoopProc == NULL) { 374a377 > } ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-05-05 10:02 Message: Logged In: YES user_id=80530 I think my testing just went off a bit. Try the patch ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-05-05 09:52 Message: Logged In: YES user_id=80530 hmmm.... and now that test case is showing the fix to be incomplete. investigating... ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-05-05 09:48 Message: Logged In: YES user_id=80530 New patch cleans up the code indentation, and supplies a test case showing the patch works. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-05-04 10:27 Message: Logged In: YES user_id=80530 Here's a patch against 8.4.13 to test. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1481986&group_id=10894 |