After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664635 - GMemory{Out,In}putStream _async functions break sub-classing with async I/O
GMemory{Out,In}putStream _async functions break sub-classing with async I/O
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-11-23 12:15 UTC by Paul Jakma
Modified: 2011-11-30 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Jakma 2011-11-23 12:15:59 UTC
If GMemoryOutputStream or GMemoryInputStream are extended by other classes, and the read or write methods overriden, then attempts to use async I/O methods on these child classes do not behave as expected, as the g_memory_input_stream_read_async and g_memory_output_stream_write_async methods directly invoke their non-async versions, rather than going through the vtable.

E.g. in g_memory_output_stream_write_async:

nwritten = g_memory_output_stream_write (...)

and in g_memory_input_stream_read_async:

nread = g_memory_input_stream_read (...)

Presumably these, and other calls of g_memory_{out,in}put_stream_read in the 2 classes, should be replaced with indirect vtable calls, so that overrides can work.
Comment 1 Dan Winship 2011-11-30 09:36:48 UTC
fixed in master