GNOME Bugzilla – Bug 748646
spice: do not leak channels on open-fd
Last modified: 2016-09-20 08:15:55 UTC
Vala closures will keep a reference on the objects they use. Make sure to disconnect the signal handler to dispose the closure. This fix leaks and may solve some issues when channels are kept around (such as Spice audio session still running because channels are alive)
Created attachment 302569 [details] [review] spice: do not leak channels on open-fd
Review of attachment 302569 [details] [review]: ::: src/spice-display.vala @@ +212,3 @@ fd = open_fd (); channel.open_fd (fd); + SignalHandler.disconnect (channel, open_fd_id); probably a stupid question but we are guaranteed that spice will only want one fd per channel?
Review of attachment 302569 [details] [review]: ::: src/spice-display.vala @@ +212,3 @@ fd = open_fd (); channel.open_fd (fd); + SignalHandler.disconnect (channel, open_fd_id); we are -> are we :)
you are right, it's not guaranteed. However, that was simplest fix I could do to fix the leak. Perhaps there is a way to tell vala not to take a strong reference on the channel?
(In reply to Marc-Andre Lureau from comment #4) > you are right, it's not guaranteed. However, that was simplest fix I could > do to fix the leak. Perhaps there is a way to tell vala not to take a strong > reference on the channel? Perhaps by not using the channel from the closure but the channel param passed to the signal handler?
Lets handle all these spice related leaks in bug#746800. *** This bug has been marked as a duplicate of bug 746800 ***