Skip to content

Multiple calls to CefDoMessageLoopWork required before shutdown. Test with External Message Pump. #245

@cztomczak

Description

@cztomczak

Fix was already added in commits d9bbf7c and 8d2c1e7, but this might not be enough.

In upstream cefclient there is a 0.05 sec sleep before each call to message loop work, so that CEF has time to process it. Looks like we also need to add it in CEF Python. I thought CefDoMessageLoopWork() was blocking, but if the sleep is required, then it means that it executes asynchronously and returns immediately.

  // We need to run the message pump until it is idle. However we don't have
  // that information here so we run the message loop "for a while".
  for (int i = 0; i < 10; ++i) {
    // Do some work.
    CefDoMessageLoopWork();

    // Sleep to allow the CEF proc to do work.
    usleep(50000);
  }

In discussion [2] Marshall states that this will hopefully be fixed as part of Issue 1805 (external message pump). So if message loop work is implemented using external pump maybe this fix won't be required any more - needs testing.

Related forum discussions:

  1. https://magpcss.org/ceforum/viewtopic.php?p=30858#p30858
  2. https://magpcss.org/ceforum/viewtopic.php?f=6&t=13994#p30093

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions