[tepl] init: init/finalize GtkSourceView



commit 99a75ce93043aa32506df60e2b93861c52e1355b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Oct 28 12:08:36 2017 +0200

    init: init/finalize GtkSourceView

 configure.ac     |    2 +-
 tepl/tepl-init.c |   14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8fada1a..99139e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ AC_SUBST(TEPL_API_VERSION)
 # Dependencies
 glib_req=2.52
 gtk_req=3.22
-gtksourceview_req=3.99.6
+gtksourceview_req=3.99.7
 libxml_req=2.5
 
 AC_CONFIG_SRCDIR([tepl/tepl.h])
diff --git a/tepl/tepl-init.c b/tepl/tepl-init.c
index 8ad0d0a..6d1243a 100644
--- a/tepl/tepl-init.c
+++ b/tepl/tepl-init.c
@@ -19,6 +19,7 @@
 
 #include "tepl-init.h"
 #include <amtk/amtk.h>
+#include <gtksourceview/gtksource.h>
 #include "tepl-abstract-factory.h"
 #include "tepl-metadata-manager.h"
 
@@ -30,7 +31,7 @@
  * This function can be called several times, but is meant to be called at the
  * beginning of main(), before any other Tepl function call.
  *
- * This function also calls amtk_init().
+ * This function also calls amtk_init() and gtk_source_init().
  *
  * Since: 3.0
  */
@@ -38,6 +39,7 @@ void
 tepl_init (void)
 {
        amtk_init ();
+       gtk_source_init ();
 }
 
 /**
@@ -47,7 +49,7 @@ tepl_init (void)
  * objects. It also properly shutdowns the metadata manager by calling
  * tepl_metadata_manager_shutdown().
  *
- * This function also calls amtk_finalize().
+ * This function also calls amtk_finalize() and gtk_source_finalize().
  *
  * It is not mandatory to call this function, it's just to be friendlier to
  * memory debugging tools (but if you don't call this function and you use the
@@ -79,10 +81,12 @@ tepl_finalize (void)
                tepl_metadata_manager_shutdown ();
                _tepl_abstract_factory_unref_singleton ();
 
-               /* Since Tepl depends on Amtk, it's better to first finalize
-                * Tepl stuff and then finalize Amtk, in case the Tepl
-                * singletons depends on Amtk.
+               /* Since Tepl depends on Amtk and GtkSourceView, it's better to
+                * first finalize Tepl stuff and then finalize the underlying
+                * libraries, in case the Tepl singletons depend on Amtk or
+                * GtkSourceView.
                 */
+               gtk_source_finalize ();
                amtk_finalize ();
 
                done = TRUE;


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