diff --git a/gnucash/gnome-utils/dialog-account.c b/gnucash/gnome-utils/dialog-account.c index 48856f4da59..c98e10fde53 100644 --- a/gnucash/gnome-utils/dialog-account.c +++ b/gnucash/gnome-utils/dialog-account.c @@ -521,10 +521,11 @@ gnc_ui_to_account (AccountWindow *aw) gtk_text_buffer_get_start_iter (aw->notes_text_buffer, &start); gtk_text_buffer_get_end_iter (aw->notes_text_buffer, &end); - string = gtk_text_buffer_get_text (aw->notes_text_buffer, &start, &end, FALSE); + char *new_string = gtk_text_buffer_get_text (aw->notes_text_buffer, &start, &end, FALSE); old_string = xaccAccountGetNotes (account); - if (null_strcmp (string, old_string) != 0) - xaccAccountSetNotes (account, string); + if (g_strcmp0 (new_string, old_string)) + xaccAccountSetNotes (account, new_string); + g_free (new_string); flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(aw->opening_balance_button)); if (xaccAccountGetIsOpeningBalance (account) != flag) diff --git a/gnucash/gnome-utils/gnc-cell-renderer-text-view.c b/gnucash/gnome-utils/gnc-cell-renderer-text-view.c index 78b3b0ddca1..3a0b1e8a299 100644 --- a/gnucash/gnome-utils/gnc-cell-renderer-text-view.c +++ b/gnucash/gnome-utils/gnc-cell-renderer-text-view.c @@ -66,7 +66,7 @@ gcrtv_editing_done (GtkCellEditable *editable, GncCellRendererTextView *cell_tv) { gchar *path; - const gchar *new_text; + gchar *new_text; if (GNC_CELL_VIEW(editable)->focus_out_id > 0) { @@ -96,6 +96,8 @@ gcrtv_editing_done (GtkCellEditable *editable, gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE(editable)); g_signal_emit_by_name (cell_tv, "edited", path, new_text); + + g_free (new_text); } static gboolean diff --git a/gnucash/gnome-utils/gnc-cell-view.c b/gnucash/gnome-utils/gnc-cell-view.c index 6004c6fef51..d2d64bbaf43 100644 --- a/gnucash/gnome-utils/gnc-cell-view.c +++ b/gnucash/gnome-utils/gnc-cell-view.c @@ -260,7 +260,7 @@ gnc_cell_view_set_text (GncCellView *cv, const gchar *text) -1); } -const gchar * +gchar * gnc_cell_view_get_text (GncCellView *cv) { GtkTextIter siter, eiter; diff --git a/gnucash/gnome-utils/gnc-cell-view.h b/gnucash/gnome-utils/gnc-cell-view.h index 601e4cc71fa..344481a19c2 100644 --- a/gnucash/gnome-utils/gnc-cell-view.h +++ b/gnucash/gnome-utils/gnc-cell-view.h @@ -60,6 +60,6 @@ GtkWidget *gnc_cell_view_new (void); void gnc_cell_view_set_text (GncCellView *cv, const gchar *text); -const gchar *gnc_cell_view_get_text (GncCellView *cv); +gchar *gnc_cell_view_get_text (GncCellView *cv); #endif /* __GNC_CELL_VIEW_H__ */ diff --git a/gnucash/gnome/dialog-customer.c b/gnucash/gnome/dialog-customer.c index 3fa9778ddd3..d327a5e580f 100644 --- a/gnucash/gnome/dialog-customer.c +++ b/gnucash/gnome/dialog-customer.c @@ -258,6 +258,7 @@ static void gnc_ui_to_customer (CustomerWindow *cw, GncCustomer *cust) gncCustomerCommitEdit (cust); gnc_resume_gui_refresh (); + g_free (text); } static gboolean check_edit_amount (GtkWidget *amount, diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c index 3359af65a81..ac6ac27bcfb 100644 --- a/gnucash/gnome/dialog-invoice.c +++ b/gnucash/gnome/dialog-invoice.c @@ -441,6 +441,7 @@ static void gnc_ui_to_invoice (InvoiceWindow *iw, GncInvoice *invoice) gncInvoiceCommitEdit (invoice); gnc_resume_gui_refresh (); + g_free (text); } static gboolean @@ -1522,6 +1523,7 @@ gnc_invoice_window_leave_notes_cb (GtkWidget *widget, GdkEventFocus *event, gtk_text_buffer_get_bounds (text_buffer, &start, &end); text = gtk_text_buffer_get_text (text_buffer, &start, &end, FALSE); gncInvoiceSetNotes (invoice, text); + g_free (text); return FALSE; } diff --git a/gnucash/gnome/dialog-order.c b/gnucash/gnome/dialog-order.c index 2ca69b3951e..c45faaa60bb 100644 --- a/gnucash/gnome/dialog-order.c +++ b/gnucash/gnome/dialog-order.c @@ -154,6 +154,7 @@ static void gnc_ui_to_order (OrderWindow *ow, GncOrder *order) gncOrderCommitEdit (order); gnc_resume_gui_refresh (); + g_free (text); } static gboolean diff --git a/gnucash/gnome/dialog-vendor.c b/gnucash/gnome/dialog-vendor.c index 10b6ab52bf3..46b458392de 100644 --- a/gnucash/gnome/dialog-vendor.c +++ b/gnucash/gnome/dialog-vendor.c @@ -178,6 +178,7 @@ static void gnc_ui_to_vendor (VendorWindow *vw, GncVendor *vendor) gncVendorCommitEdit (vendor); gnc_resume_gui_refresh (); + g_free (text); } static gboolean check_entry_nonempty (GtkWidget *entry,