[devhelp: 16/16] Call dh_book_manager_free_singleton() at the end of main()



commit 54038fe2b2edf97a42475814cab444be4ea31937
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon May 1 18:55:26 2017 +0200

    Call dh_book_manager_free_singleton() at the end of main()
    
    The function needs to be exported by the library, because the Devhelp
    app is dynamically linked to the Devhelp library.

 docs/reference/devhelp-sections.txt |    2 ++
 src/dh-book-manager.c               |    2 +-
 src/dh-book-manager.h               |    4 ++--
 src/dh-main.c                       |    2 ++
 4 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/devhelp-sections.txt b/docs/reference/devhelp-sections.txt
index 59bcd77..f150ad3 100644
--- a/docs/reference/devhelp-sections.txt
+++ b/docs/reference/devhelp-sections.txt
@@ -109,6 +109,8 @@ DH_IS_BOOK_MANAGER
 DH_IS_BOOK_MANAGER_CLASS
 DH_TYPE_BOOK_MANAGER
 dh_book_manager_get_type
+<SUBSECTION Private>
+dh_book_manager_free_singleton
 </SECTION>
 
 <SECTION>
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index 6188458..9c51e33 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -832,7 +832,7 @@ dh_book_manager_get_singleton (void)
 }
 
 void
-_dh_book_manager_free_singleton (void)
+dh_book_manager_free_singleton (void)
 {
         if (singleton != NULL)
                 g_object_unref (singleton);
diff --git a/src/dh-book-manager.h b/src/dh-book-manager.h
index 5841f52..b0e5666 100644
--- a/src/dh-book-manager.h
+++ b/src/dh-book-manager.h
@@ -54,8 +54,8 @@ DhBookManager *dh_book_manager_new                   (void);
 G_DEPRECATED
 void           dh_book_manager_populate              (DhBookManager *book_manager);
 
-G_GNUC_INTERNAL
-void           _dh_book_manager_free_singleton       (void);
+/* Normally private */
+void           dh_book_manager_free_singleton       (void);
 
 G_END_DECLS
 
diff --git a/src/dh-main.c b/src/dh-main.c
index a9b0f77..4e5709f 100644
--- a/src/dh-main.c
+++ b/src/dh-main.c
@@ -24,6 +24,7 @@
 #include <gtk/gtk.h>
 
 #include "dh-app.h"
+#include "dh-book-manager.h"
 #include "dh-settings.h"
 
 int
@@ -45,6 +46,7 @@ main (int argc, char **argv)
 
         g_object_unref (application);
 
+        dh_book_manager_free_singleton ();
         dh_settings_free_singleton ();
 
         return status;


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