summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-02-26 10:14:57 +0100
committerlukefromdc <[email protected]>2020-02-27 05:50:08 +0000
commit8bdaa6361e8a9b44efaabded670f2efbe0791eef (patch)
tree02b3bf9a123ee93af094f9f9e5fa0fd34485a09e
parent8de77e33ab168df33b2a4bc7a7fe45aed75e9040 (diff)
downloadmate-calc-8bdaa6361e8a9b44efaabded670f2efbe0791eef.tar.bz2
mate-calc-8bdaa6361e8a9b44efaabded670f2efbe0791eef.tar.xz
free variables
-rw-r--r--src/math-history-entry.c5
-rw-r--r--src/math-history.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/math-history-entry.c b/src/math-history-entry.c
index baf3a7c..6948eac 100644
--- a/src/math-history-entry.c
+++ b/src/math-history-entry.c
@@ -98,8 +98,8 @@ math_history_entry_insert_entry(MathHistoryEntry *history_entry, char *equation,
builder = gtk_builder_new();
if(gtk_builder_add_from_resource (builder, UI_HISTORY_ENTRY_RESOURCE_PATH, &error) == 0)
{
- g_print("gtk_builder_add_from_resource FAILED\n");
- g_print("%s\n",error->message);
+ g_warning("Error loading history-entry UI: %s", error->message);
+ g_clear_error(&error);
return;
}
grid = GET_WIDGET(builder, "grid");
@@ -113,6 +113,7 @@ math_history_entry_insert_entry(MathHistoryEntry *history_entry, char *equation,
gtk_label_set_text(GTK_LABEL(history_entry->priv->equation_label), history_entry->priv->equation_string);
gtk_label_set_text(GTK_LABEL(history_entry->priv->answer_label), final_answer);
gtk_builder_connect_signals(builder, history_entry);
+ g_free(final_answer);
}
static void
diff --git a/src/math-history.c b/src/math-history.c
index 18b9bda..e350ef8 100644
--- a/src/math-history.c
+++ b/src/math-history.c
@@ -52,7 +52,7 @@ scroll_bottom_cb(MathHistory *history, gpointer data)
static gboolean
check_history(MathHistory *history, char *equation)
-{ /* Checks if the last inserted calculation is the same as the current calculation to be inserted in history-history */
+{ /* Checks if the last inserted calculation is the same as the current calculation to be inserted in history */
if (history->priv->items_count >= 1 && g_strcmp0(equation, history->priv->prev_equation)==0)
return TRUE; /* returns true if last entered equation is the same as the current equation */
else
@@ -61,7 +61,7 @@ check_history(MathHistory *history, char *equation)
void
math_history_insert_entry (MathHistory *history, char *equation, MPNumber *answer, int number_base)
-{ /* Inserts a new entry into the history-history listbox */
+{ /* Inserts a new entry into the history listbox */
history->priv->entry = math_history_entry_new(history->priv->equation);
gboolean check = check_history (history, equation);
history->priv->prev_equation = g_strdup(equation);