soup-message-io: keep cancellable alive for duration of io_run_until
authorDan Winship <danw@gnome.org>
Tue, 15 May 2012 16:20:19 +0000 (12:20 -0400)
committerDan Winship <danw@gnome.org>
Tue, 15 May 2012 16:23:32 +0000 (12:23 -0400)
commitdba687f01cfe5aad36c3df1b830b1e1d6ab4592d
tree371af8e3ca744accb488b4234e366e2e8a019607
parentdbc41f65f80336052f57a2e3cfb48163a2a6185a
soup-message-io: keep cancellable alive for duration of io_run_until

io_run() passes io->cancellable to io_run_until(), but io may be
destroyed (and cancellable unreffed) before io_run_until() returns,
causing it to eventually call g_cancellable_is_cancelled() on garbage.
Fix by reffing it around the io_run_until() call (though really this
is just another example of "SoupMessageIOData needs to be
refcounted".)

Tweak misc-test to test this case.

Fixes crasher in rygel test case. Based on a patch from Ray Strode.
https://bugzilla.gnome.org/show_bug.cgi?id=676038
libsoup/soup-message-io.c
tests/misc-test.c