[libgweather] Don't crash when unsetting the location
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather] Don't crash when unsetting the location
- Date: Thu, 26 Sep 2013 11:48:20 +0000 (UTC)
commit c815875154fbeb653c9f0313912409eb22384036
Author: Sjoerd Simons <sjoerd luon net>
Date: Sat Sep 21 18:08:57 2013 +0200
Don't crash when unsetting the location
Setting the location of the entry to NULL is documented to unset the
location, but unfortunately in practice it caused a crash in
gweather_location_equal()
https://bugzilla.gnome.org/show_bug.cgi?id=708586
libgweather/location-entry.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libgweather/location-entry.c b/libgweather/location-entry.c
index 7fe58fc..7712879 100644
--- a/libgweather/location-entry.c
+++ b/libgweather/location-entry.c
@@ -321,6 +321,11 @@ gweather_location_entry_set_location (GWeatherLocationEntry *entry,
completion = gtk_entry_get_completion (GTK_ENTRY (entry));
model = gtk_entry_completion_get_model (completion);
+ if (loc == NULL) {
+ set_location_internal (entry, model, NULL, NULL);
+ return;
+ }
+
gtk_tree_model_get_iter_first (model, &iter);
do {
gtk_tree_model_get (model, &iter,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]