GNOME Bugzilla – Bug 769182
files-view: unref directory after calling _get_by_uri()
Last modified: 2016-07-28 11:58:16 UTC
My previous findings were cleanups not being done at the end of execution, which is a questionable practice at best (I read arguments for and against that). This one is different, however, in that the code is hit during normal operation.
Created attachment 332131 [details] [review] files-view: unref directory after calling _get_by_uri() update_scripts_menu() and update_templates_menu() do not unref the directories after calling nautilus_directory_get_by_uri(), which results in leaks. This commit fixes that by adding calls to nautilus_directory_unref().
(In reply to Ernestas Kulik from comment #0) > My previous findings were cleanups not being done at the end of execution, > which is a questionable practice at best (I read arguments for and against > that). Source? Why cleaning up before end of execution would be bad?
Review of attachment 332131 [details] [review]: whops! Thanks much Ernestas! feel free to 3.20 too.
(In reply to Carlos Soriano from comment #2) > (In reply to Ernestas Kulik from comment #0) > > My previous findings were cleanups not being done at the end of execution, > > which is a questionable practice at best (I read arguments for and against > > that). > > Source? Why cleaning up before end of execution would be bad? It’s just anecdata I gathered from Stack Overflow and other sites, but, basically, some programmers intentionally don’t do that to achieve quick shutdowns. There was probably something else, but I can’t recall. The arguments against that, of course, are that this is making assumptions about the memory management of the kernel (I would say that this never applies in practice today) and that cleaning up after yourself in general is a good practice.
Attachment 332131 [details] pushed as 2698802 - files-view: unref directory after calling _get_by_uri()
(In reply to Ernestas Kulik from comment #4) > (In reply to Carlos Soriano from comment #2) > > (In reply to Ernestas Kulik from comment #0) > > > My previous findings were cleanups not being done at the end of execution, > > > which is a questionable practice at best (I read arguments for and against > > > that). > > > > Source? Why cleaning up before end of execution would be bad? > > It’s just anecdata I gathered from Stack Overflow and other sites, but, > basically, some programmers intentionally don’t do that to achieve quick > shutdowns. There was probably something else, but I can’t recall. > > Stack Overflow > to achieve quick shutdowns omg