[epiphany] ephy-history-service: remove some dangerous g_object_unref() calls
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-history-service: remove some dangerous g_object_unref() calls
- Date: Thu, 6 Sep 2012 19:35:52 +0000 (UTC)
commit dddc036986d7fc8da4ce735ffdccf91c2315f6be
Author: Claudio Saavedra <csaavedra igalia com>
Date: Thu Sep 6 13:08:47 2012 +0300
ephy-history-service: remove some dangerous g_object_unref() calls
If there is an error building a statement, the returned value is
always NULL. Calling g_object_unref() on them will lead to trouble.
https://bugzilla.gnome.org/show_bug.cgi?id=683475
lib/history/ephy-history-service-hosts-table.c | 2 --
lib/history/ephy-history-service-urls-table.c | 2 --
lib/history/ephy-history-service-visits-table.c | 2 +-
3 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/lib/history/ephy-history-service-hosts-table.c b/lib/history/ephy-history-service-hosts-table.c
index 04be063..0a3aa86 100644
--- a/lib/history/ephy-history-service-hosts-table.c
+++ b/lib/history/ephy-history-service-hosts-table.c
@@ -300,7 +300,6 @@ ephy_history_service_find_host_rows (EphyHistoryService *self, EphyHistoryQuery
if (error) {
g_error ("Could not build hosts table query statement: %s", error->message);
g_error_free (error);
- g_object_unref (statement);
return NULL;
}
if (query->from > 0) {
@@ -451,7 +450,6 @@ ephy_history_service_delete_host_row (EphyHistoryService *self,
if (error) {
g_error ("Could not build urls table query statement: %s", error->message);
g_error_free (error);
- g_object_unref (statement);
return;
}
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index f0d4451..b37d58f 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -295,7 +295,6 @@ ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery *
if (error) {
g_error ("Could not build urls table query statement: %s", error->message);
g_error_free (error);
- g_object_unref (statement);
return NULL;
}
@@ -392,7 +391,6 @@ ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url)
if (error) {
g_error ("Could not build urls table query statement: %s", error->message);
g_error_free (error);
- g_object_unref (statement);
return;
}
diff --git a/lib/history/ephy-history-service-visits-table.c b/lib/history/ephy-history-service-visits-table.c
index 0beaa23..1b9e5b3 100644
--- a/lib/history/ephy-history-service-visits-table.c
+++ b/lib/history/ephy-history-service-visits-table.c
@@ -155,7 +155,7 @@ ephy_history_service_find_visit_rows (EphyHistoryService *self, EphyHistoryQuery
if (error) {
g_error ("Could not build visits table query statement: %s", error->message);
g_error_free (error);
- g_object_unref (statement);
+ return NULL;
}
if (query->from >= 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]