Remove unnecessary NULL checks before g_free()

g_free() is NULL-safe
parent 4a52b58b
...@@ -233,8 +233,7 @@ _on_text_changed (GtkTextBuffer * text, struct text_view_state *state) ...@@ -233,8 +233,7 @@ _on_text_changed (GtkTextBuffer * text, struct text_view_state *state)
GtkTextIter start, end; GtkTextIter start, end;
gtk_text_buffer_get_bounds (text, &start, &end); gtk_text_buffer_get_bounds (text, &start, &end);
if (state->str) g_free (state->str);
g_free (state->str);
state->str = gtk_text_buffer_get_text (text, &start, &end, FALSE); state->str = gtk_text_buffer_get_text (text, &start, &end, FALSE);
g_object_set (state->state->shader, "update-shader", TRUE, NULL); g_object_set (state->state->shader, "update-shader", TRUE, NULL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment