[epiphany/gnome-3-22] history-service: Fix leak when clearing all history



commit b03a62304845b1140d49be58fae72e400138e677
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Feb 18 22:05:21 2017 -0600

    history-service: Fix leak when clearing all history
    
    Closing the connection is great, but not enough. We're leaking our
    wrapper object.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778649

 lib/history/ephy-history-service.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index f830d87..138a425 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -381,6 +381,9 @@ ephy_history_service_open_database_connections (EphyHistoryService *self)
 
   g_assert (self->history_thread == g_thread_self ());
 
+  if (self->history_database != NULL)
+    g_object_unref (self->history_database);
+
   self->history_database = ephy_sqlite_connection_new (self->read_only ? 
EPHY_SQLITE_CONNECTION_MODE_READ_ONLY
                                                                        : 
EPHY_SQLITE_CONNECTION_MODE_READWRITE);
   ephy_sqlite_connection_open (self->history_database, self->history_filename, &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]