Closed Bug 1227008 Opened 9 years ago Closed 9 years ago

GtkPaperSize leak in nsPrintSettingsGTK::SetGtkPrintSettings()

Categories

(Core :: Widget: Gtk, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: karlt, Unassigned)

References

Details

Attachments

(1 file)

The GtkPageSetup already has a GtkPaperSize that we can manipulate directly.
The GtkPrintSettings has a serialization of the GtkPaperSize.
gtk_page_setup_get_paper_size() returns a pointer to the object in the
GtkPageSetup, but gtk_print_settings_get_paper_size() returns a new
GtkPaperSize.
bug 1227008 use GtkPaperSize in GtkPageSetup directly, instead of maintaining a separate copy r?acomminos

Fixes a leak in nsPrintSettingsGTK::SetGtkPrintSettings() and
missed paper size copy in operator= (bug 965991).

GtkPageSetup always has a GtkPaperSize [1], which is returned from
gtk_page_setup_get_paper_size() as indicated in the docs [2]:
"Return value: the paper size" without "or NULL".

[1] https://git.gnome.org/browse/gtk+/tree/gtk/gtkpagesetup.c?h=2.18.0#n68
[2] https://git.gnome.org/browse/gtk+/tree/gtk/gtkpagesetup.c?h=2.18.0#n164
Attachment #8691193 - Flags: review?(andrew)
Blocks: 965991
See Also: 965991
Comment on attachment 8691193 [details]
MozReview Request: bug 1227008 use GtkPaperSize in GtkPageSetup directly, instead of maintaining a separate copy r?acomminos

https://reviewboard.mozilla.org/r/26105/#review23463

Looks good to me, thanks!

::: widget/gtk/nsPrintSettingsGTK.h:138
(Diff revision 1)
>     * - mPrintSettings, mPageSetup and mPaperSize are just new objects with defaults determined by GTK.

Comment referring to mPaperSize can be removed, no big deal though.
Attachment #8691193 - Flags: review?(andrew) → review+
(In reply to Andrew Comminos [:acomminos] from comment #4)
> Comment referring to mPaperSize can be removed

Done, thanks.
https://hg.mozilla.org/mozilla-central/rev/45a665ae8dc7
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
No longer blocks: 965991
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: