Skip to content
Commit a379a0ad authored by Jasper St. Pierre's avatar Jasper St. Pierre Committed by Matthias Clasen
Browse files

gapplication: Acquire the main context before running

Otherwise, we'll acquire it on every loop iteration, which can leave us
vulnerable to racing another thread for the acquisition of the main
context.

This can break methods like g_main_context_invoke, which try to acquire
a context to figure out if it can invoke the method synchronously or
need to defer to an idle. In these cases, it isn't guaranteed that the
invocation function will be invoked in the default main context,
e.g. the one that GApplication is holding.

This also matches what GMainLoop is doing.

https://bugzilla.gnome.org/show_bug.cgi?id=752983
parent 5e73ca97
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment