Skip to content

Commit b2edf3b

Browse files
Merge pull request livecode#1290 from runrevsebastien/bugfix-13360
[[ Bug 13360 ]] LiveCode application takes up 98% of processor
2 parents efc9216 + 75ccc61 commit b2edf3b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/notes/bugfix-13360.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# LiveCode application takes up 98% of processor

engine/src/desktop-dc.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,16 @@ Boolean MCScreenDC::wait(real8 duration, Boolean dispatch, Boolean anyevent)
853853

854854
// MW-2014-07-16: [[ Bug 12799 ]] If polling sockets does something then don't wait for long.
855855
extern Boolean MCS_handle_sockets();
856+
857+
// SN-2014-10-17: [[ Bug 13360 ]] If MCS_handle_sockets returns true, we don't want to get stuck in a
858+
// loop waiting 0.0 s for events. That was causing issues in MCRead::readuntil, if data arrived after
859+
// the call to read()
856860
if (MCS_handle_sockets())
861+
{
862+
if (anyevent)
863+
done = True;
857864
t_sleep = 0.0;
865+
}
858866

859867
// Wait for t_sleep seconds and collect at most one event. If an event
860868
// is collected and anyevent is True, then we are done.

0 commit comments

Comments
 (0)