pull: Avoid leaking signal handlers across fetch requests
libsoup will cache sessions, so it might be the case that we get a reused session when pulling from the same repo multiple times in one process. In this case we were leaking signal connections, which caused callbacks into freed memory with bad consequences. Fix it by tying the signal connection to the object lifetime.
This commit is contained in:
parent
f0a02fbf20
commit
889b86e96d
|
|
@ -201,10 +201,10 @@ _ostree_fetcher_init (OstreeFetcher *self)
|
|||
|
||||
self->max_outstanding = 3 * max_conns;
|
||||
|
||||
g_signal_connect (self->session, "request-started",
|
||||
G_CALLBACK (on_request_started), self);
|
||||
g_signal_connect (self->session, "request-unqueued",
|
||||
G_CALLBACK (on_request_unqueued), self);
|
||||
g_signal_connect_object (self->session, "request-started",
|
||||
G_CALLBACK (on_request_started), self, 0);
|
||||
g_signal_connect_object (self->session, "request-unqueued",
|
||||
G_CALLBACK (on_request_unqueued), self, 0);
|
||||
|
||||
self->sending_messages = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify)g_object_unref);
|
||||
|
|
|
|||
Loading…
Reference in New Issue