measure_disk_usage: skip progress on NULL callback
authorRyan Lortie <desrt@desrt.ca>
Tue, 17 Sep 2013 13:40:04 +0000 (09:40 -0400)
committerRyan Lortie <desrt@desrt.ca>
Tue, 17 Sep 2013 13:44:23 +0000 (09:44 -0400)
commitdbf95a5ae94441dc235d8dcf003f05cb5c6bd84b
tree68b60e85de6d11b09570f882d40372afcafdf5f6
parent1a9b739c3176f0fd89aaadb10d90680c345c2d53
measure_disk_usage: skip progress on NULL callback

In the real_..._async wrapper for GFile.measure_disk_usage, skip the
wrapping of the progress callback in the case that the user gave a NULL
callback to the async function.  This is a performance improvement
because the sync version won't have to do continuous sampling of the
clock to issue a call to the wrapper which will then do nothing.

Unfortunately, I made this simplifying assumption when writing the
wrapper, but forgot to actually implement it when making the sync call.
As a result, the wrapper is still called, and invokes the NULL callback,
causing a segfault.

Make sure we pass NULL if the user's callback was NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=707787
gio/gfile.c