Skip to content
Commit be5c12c4 authored by Colin Walters's avatar Colin Walters
Browse files

Fix assertions during context dispose

The current toggle ref code has and assertion that we don't have a
DOWN notification pending while the object is supposed to be live -
and during normal operation, this is true.

Except at context shutdown, we force the JS object to be destroyed,
which can cause recursion into a dispose handler of a gobject, which
can then queue a toggle down.  Then we later force dispose that
object, and find the DOWN pending.

Now, we could simply avoid all of this insanity by default and allow
the kernel to clean up our state much faster, in a more power
efficient way by simply not doing any of this...

However, there are valid use cases for wanting "clean" exits, such as
valgrind.  So this patch fixes things up for the dispose by iterating
over the entire live object list before we drop into the JS context
destruction, breaking the JS <-> C association.  This safely clears
the toggle refs, so the JS side is just JS cleanup, we don't reenter
GObject land.

This will make several of the OSTree tests written using gjs start
passing in Continuous again.  \o/

https://bugzilla.gnome.org/show_bug.cgi?id=724060
parent 4ee21260
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