Skip to content

Commit

Permalink
Printing: properly claim ownership of the printing Scintilla widget
Browse files Browse the repository at this point in the history
This avoids a GObject warning about unref-ing a floating object on
print termination.
  • Loading branch information
b4n committed Jun 23, 2014
1 parent 881ca4f commit d6c980f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/printing.c
Expand Up @@ -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);
Expand Down

0 comments on commit d6c980f

Please sign in to comment.