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



commit 669c6837522552f4e43d440f936b3c2eeefafa40
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 9ca6359..18b5961 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -377,6 +377,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]