[geany/geany] d6c980: Printing: properly claim ownership of the printing Scintilla widget

Colomban Wendling git-noreply at xxxxx
Mon Jun 23 16:38:59 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 23 Jun 2014 16:38:59 UTC
Commit:      d6c980f2fcdf49b731aacbd9e4751cbb9d85cafe
             https://github.com/geany/geany/commit/d6c980f2fcdf49b731aacbd9e4751cbb9d85cafe

Log Message:
-----------
Printing: properly claim ownership of the printing Scintilla widget

This avoids a GObject warning about unref-ing a floating object on
print termination.


Modified Paths:
--------------
    src/printing.c

Modified: src/printing.c
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -349,6 +349,8 @@ static void begin_print(GtkPrintOperation *operation, GtkPrintContext *context,
 
 	/* setup printing scintilla object */
 	dinfo->sci = editor_create_widget(dinfo->doc->editor);
+	/* since we won't add the widget to any container, assume it's ownership */
+	g_object_ref_sink(dinfo->sci);
 	scintilla_send_message(dinfo->sci, SCI_SETDOCPOINTER, 0,
 			scintilla_send_message(dinfo->doc->editor->sci, SCI_GETDOCPOINTER, 0, 0));
 	highlighting_set_styles(dinfo->sci, dinfo->doc->file_type);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list