After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672125 - gtk_enumerate_printers() doesn't call the destroy notify function in some cases
gtk_enumerate_printers() doesn't call the destroy notify function in some cases
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-03-15 11:18 UTC by Carlos Garcia Campos
Modified: 2012-03-15 13:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make sure destroy function is always called by gtk_enumerate_printers (1.22 KB, patch)
2012-03-15 11:20 UTC, Carlos Garcia Campos
none Details | Review
Make sure destroy function is always called by gtk_enumerate_printers (2.69 KB, patch)
2012-03-15 13:17 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-03-15 11:18:01 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.
Comment 1 Carlos Garcia Campos 2012-03-15 11:20:29 UTC
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.
Comment 2 Alexander Larsson 2012-03-15 11:49:00 UTC
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).
Comment 3 Carlos Garcia Campos 2012-03-15 13:17:38 UTC
Created attachment 209833 [details] [review]
Make sure destroy function is always called by gtk_enumerate_printers

Patch updated as suggested by alex
Comment 4 Alexander Larsson 2012-03-15 13:42:47 UTC
looks good to me, please commit