engine: fix race in match rule adding
commit54a490e4d9b5a788fa63011fb6ff73ad1c1ebf80
authorRyan Lortie <desrt@desrt.ca>
Sat, 22 Feb 2014 01:04:39 +0000 (21 20:04 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sat, 22 Feb 2014 01:07:00 +0000 (21 20:07 -0500)
tree20ea055d139e858ef071367ae05bcb11cfc06c44
parent363eda5b0572eac73d5514b4f3dbd0ab7e250b4d
engine: fix race in match rule adding

Due to the usual way async in dconf works, we can start getting replies
immediately (without returning to the mainloop).  For this reason, we
must be sure that we do not modify the OutstandingWatch structure at any
point after we've issued even one call because the results may already
be coming in.

For this reason, we must add up the 'pending' count in a separate loop
run before we start making the calls.

https://bugzilla.gnome.org/show_bug.cgi?id=724929
engine/dconf-engine.c