GNOME Bugzilla – Bug 672125
gtk_enumerate_printers() doesn't call the destroy notify function in some cases
Last modified: 2012-03-15 13:50:55 UTC
When GtkPrinterFunc always returns FALSE, for example when looking for a non existent printer, if print list is done for all backends or print backend status is UNAVAILABLE, gtk_enumerate_printers() finishes with an empty backend list and destroy function is never called.
Created attachment 209816 [details] [review] Make sure destroy function is always called by gtk_enumerate_printers We need to check the backend list again after calling list_printers_init for all backends and finish the enumeration if it's empty.
I think it would be better to fix list_printers_init () to free the list on a NULL backends after removing itself, just like list_done_cb does. (Probably by sharing the same code for this in a helper).
Created attachment 209833 [details] [review] Make sure destroy function is always called by gtk_enumerate_printers Patch updated as suggested by alex
looks good to me, please commit