Allow recursive calls to wxEventLoop::Yield().

There doesn't seem to be any reason to forbid them and this change allows
wxExecute() without wxEXEC_NOEVENTS to work without assertion failures when
called from inside wxYield().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-10 16:51:06 +00:00
parent 36f51e1479
commit dc65fa8d5a
4 changed files with 20 additions and 22 deletions

View File

@@ -224,7 +224,6 @@ public:
user to perform actions which are not compatible with the current task.
Disabling menu items or whole menus during processing can avoid unwanted
reentrance of code: see ::wxSafeYield for a better function.
You can avoid unwanted reentrancies also using IsYielding().
Note that Yield() will not flush the message logs. This is intentional as
calling Yield() is usually done to quickly update the screen and popping up
@@ -232,10 +231,9 @@ public:
messages immediately (otherwise it will be done during the next idle loop
iteration), call wxLog::FlushActive.
Calling Yield() recursively is normally an error and an assert failure is
raised in debug build if such situation is detected. However if the
@a onlyIfNeeded parameter is @true, the method will just silently
return @false instead.
If @a onlyIfNeeded parameter is @true and the flow control is already
inside Yield(), i.e. IsYielding() returns @true, the method just
silently returns @false and doesn't do anything.
*/
bool Yield(bool onlyIfNeeded = false);