Fix GSource leak from idle processing
It is apparently not safe to call gtk_events_pending() from the idle callback, as it can result in GLib failing to properly dereference some GSource objects. This leads to increasingly large amounts of CPU time being spent in GLib processing internal lists of these GSource objects. So avoid calling gtk_events_pending(), as it is not strictly necessary because our idle source will remain installed if wxIdleEvent::RequestMore() is used, and if no events have arrived the idle callback will be invoked again. Closes #23364. See #23368.
This commit is contained in:
parent
23ccdb23c8
commit
2d32b8cdd8
1 changed files with 2 additions and 5 deletions
|
|
@ -142,12 +142,9 @@ bool wxApp::DoIdle()
|
|||
gs_focusChange = 0;
|
||||
}
|
||||
|
||||
bool needMore;
|
||||
do {
|
||||
ProcessPendingEvents();
|
||||
ProcessPendingEvents();
|
||||
const bool needMore = ProcessIdle();
|
||||
|
||||
needMore = ProcessIdle();
|
||||
} while (needMore && gtk_events_pending() == 0);
|
||||
gdk_threads_leave();
|
||||
|
||||
#if wxUSE_THREADS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue