[Spice-devel] [spice-gtk 1/3] wocky: Simplify wocky_http_proxy_connect_finish()

Christophe Fergeau cfergeau at redhat.com
Wed Aug 3 07:54:38 UTC 2016


On Wed, Aug 03, 2016 at 09:49:51AM +0200, Christophe Fergeau wrote:
> Rather than returning the whole ConnectAsyncData struct with
> g_task_return_pointer(), we can return only the GIOStream object as this
> is what we are interested in.
> This has the side-effect of fixing a ConnectAsyncData leak as after
> calling g_task_propagate_pointer() the old code had ownership of the
> ConnectAsyncData instance but was never freeing it.


I've added this valgrind trace to the commit log:

    The leak is:
    ==20010== 4,348 (56 direct, 4,292 indirect) bytes in 1 blocks are definitely lost in loss record 20,7
    ==20010==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
    ==20010==    by 0xD0F6EB0: g_malloc0 (gmem.c:124)
    ==20010==    by 0x75C0978: wocky_http_proxy_connect_async (wocky-http-proxy.c:359)
    ==20010==    by 0xCB4E22C: g_socket_client_connected_callback (gsocketclient.c:1548)
    ==20010==    by 0xCB57342: g_task_return_now (gtask.c:1107)
    ==20010==    by 0xCB579E5: g_task_return (gtask.c:1165)
    ==20010==    by 0xCB4FB1C: g_socket_connection_connect_callback (gsocketconnection.c:236)
    ==20010==    by 0xCB47160: socket_source_dispatch (gsocket.c:3543)
    ==20010==    by 0xD0F1702: g_main_dispatch (gmain.c:3154)
    ==20010==    by 0xD0F1702: g_main_context_dispatch (gmain.c:3769)
    ==20010==    by 0xD0F1AAF: g_main_context_iterate.isra.29 (gmain.c:3840)
    ==20010==    by 0xD0F1B5B: g_main_context_iteration (gmain.c:3901)
    ==20010==    by 0xCB7D58C: g_application_run (gapplication.c:2381)
    ==20010==    by 0x41571C: main (remote-viewer-main.c:42)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160803/9d8a73fe/attachment.sig>


More information about the Spice-devel mailing list