summaryrefslogtreecommitdiff
path: root/gtk/gtkquery.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-07-21 20:39:29 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-07-21 20:39:29 -0400
commit38a5db8f83aa9eaf7340c049f91bcf6ed670382b (patch)
tree6633cb8e9bf93c2ea8486c84dbdad4724f64b057 /gtk/gtkquery.c
parent94187127821a31b3367ce7b60d4bd5f8e874f6cd (diff)
downloadgtk+-38a5db8f83aa9eaf7340c049f91bcf6ed670382b.tar.gz
GtkQuery: Make API follow GTK+ conversions
We generally have const getters for strings, and the two users of this API were promptly leaking the (unexpected) copy they got from gtk_query_get_location and gtk_query_get_text.
Diffstat (limited to 'gtk/gtkquery.c')
-rw-r--r--gtk/gtkquery.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkquery.c b/gtk/gtkquery.c
index a69b278606..bc81b7da3e 100644
--- a/gtk/gtkquery.c
+++ b/gtk/gtkquery.c
@@ -70,10 +70,10 @@ gtk_query_new (void)
}
-gchar *
+const gchar *
gtk_query_get_text (GtkQuery *query)
{
- return g_strdup (query->priv->text);
+ return query->priv->text;
}
void
@@ -87,10 +87,10 @@ gtk_query_set_text (GtkQuery *query,
query->priv->words = NULL;
}
-gchar *
+const gchar *
gtk_query_get_location (GtkQuery *query)
{
- return g_strdup (query->priv->location_uri);
+ return query->priv->location_uri;
}
void