GNOME Bugzilla – Bug 369338
Improvements for the get_existing_connection functions
Last modified: 2006-11-13 20:47:26 UTC
See attached patch :) It let's get_existing_connection first check if the connection we're trying to match is one for the right protocol :), fixes a crash when Inspecting the self-handle failed and moves the clean-up of the loop (freeing/unreffing) to one central place.
Created attachment 75830 [details] [review] get_existing_connection improvements
*** Bug 368801 has been marked as a duplicate of this bug. ***
Some comments on the patch: - Your found boolean is never used. - I don't like goto, is it possible to not use that ? - if statements should always have brackets even if there is only one instruction in the block. if (foo) { bar; } Otherwise the patch seems to make his job and fix a crash I have so I would be happy to get it committed if the code is cleaned up :-) Simons > Can you update your patch ? Sorry I don't have time now to change it myself. Thanks for the patch !!!
Created attachment 76467 [details] [review] Updated patch >Some comments on the patch: > > - Your found boolean is never used. Woops, you found a bug in the patch :) Fixed in this version > - if statements should always have brackets even if there is only one > instruction in the block. Fixed. > - I don't like goto, is it possible to not use that ? One can easily prove that you an _always_ avoid goto's. Otoh that doesn't mean it's good to do that :) By using goto the way i did here itreplaces 5 cleanup blocks by one general one. Which is easier to maintain and easier to prove correctness for :)
Created attachment 76484 [details] [review] Add missing part of the patch First part of the patch was missing in the last one.. Adding an updated version
commited, thanks !