[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-106-gf5b443d

Rémi Cardona nobody at users.sourceforge.net
Wed Mar 23 00:11:46 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  f5b443d2ae07fd3535a3e79f8acd8cd43dd23b7b (commit)
       via  5ef2a37fe8193f3ba306d66c0f528a6ab7bfe3b5 (commit)
       via  627f62fa1f21c8cfd0e08fb035035a19b3dc16e9 (commit)
      from  0c340b07de6a80ce96e770994c798797a4be08bf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f5b443d2ae07fd3535a3e79f8acd8cd43dd23b7b
Author: Rémi Cardona <remi at gentoo.org>
Date:   Tue Mar 22 23:59:27 2011 +0100

    tests: add missing #include

commit 5ef2a37fe8193f3ba306d66c0f528a6ab7bfe3b5
Author: Rémi Cardona <remi at gentoo.org>
Date:   Tue Mar 22 23:56:55 2011 +0100

    erreur.c: add gsb_debug_finish_log() to avoid declaring 'debug_file' extern
    
    This even allows declaring it static

commit 627f62fa1f21c8cfd0e08fb035035a19b3dc16e9
Author: Rémi Cardona <remi at gentoo.org>
Date:   Tue Mar 22 23:54:33 2011 +0100

    erreur.c: move debug_filename variable inside the only function that uses it, fix a mem leak

-----------------------------------------------------------------------

Changes:
diff --git a/src/erreur.c b/src/erreur.c
index 1eedb2f..082073f 100644
--- a/src/erreur.c
+++ b/src/erreur.c
@@ -66,8 +66,7 @@ static gint debugging_grisbi;
 
 /* path and name of the file containing the log when debug mode is active
  * this values should not be freed when begin a new file to continue the log */
-gchar *debug_filename = NULL;
-FILE *debug_file = NULL;
+static FILE *debug_file = NULL;
 
 /*************************************************************************************************************/
 void traitement_sigsegv ( gint signal_nb )
@@ -448,6 +447,7 @@ GtkWidget * print_backtrace ( void )
 gboolean gsb_debug_start_log ( void )
 {
     gchar *tmp_str;
+    gchar *debug_filename;
 
     devel_debug ( NULL );
 
@@ -482,6 +482,8 @@ gboolean gsb_debug_start_log ( void )
 
     debug_file = g_fopen ( debug_filename, "w" );
 
+    g_free ( debug_filename );
+
     if ( debug_file )
     {
         GtkWidget *widget;
@@ -555,6 +557,16 @@ gboolean gsb_debug_start_log ( void )
 
 /**
  *
+ * */
+void gsb_debug_finish_log ( void )
+{
+    if ( debug_file )
+        fclose (debug_file);
+}
+
+
+/**
+ *
  *
  *
  */
diff --git a/src/erreur.h b/src/erreur.h
index e1336cb..c22318b 100644
--- a/src/erreur.h
+++ b/src/erreur.h
@@ -54,6 +54,7 @@ void debug_print_log_string ( gchar *prefixe,
                         const char *function,
                         const gchar *msg );
 gboolean gsb_debug_start_log ( void );
+void gsb_debug_finish_log ( void );
 void initialize_debugging ( void );
 void traitement_sigsegv ( gint signal_nb );
 /* END_DECLARATION */
diff --git a/src/main.c b/src/main.c
index 77b5022..32b7722 100644
--- a/src/main.c
+++ b/src/main.c
@@ -108,7 +108,6 @@ static void main_window_set_size_and_position ( void );
 G_MODULE_EXPORT GtkWidget *window = NULL;
 
 /*START_EXTERN*/
-extern FILE *debug_file;
 extern gchar *nom_fichier_comptes;
 extern gchar *titre_fichier;
 /*END_EXTERN*/
@@ -655,8 +654,8 @@ gboolean gsb_grisbi_close ( void )
         gtk_widget_destroy ( window );
 
     /* clean finish of the debug file */
-    if (etat.debug_mode && debug_file)
-        fclose (debug_file);
+    if ( etat.debug_mode )
+        gsb_debug_finish_log ( );
 
     /* clean the initial vars */
     gsb_main_free_global_definitions ( );
diff --git a/src/tests/gsb_real_cunit.c b/src/tests/gsb_real_cunit.c
index d82c0e5..17be77c 100644
--- a/src/tests/gsb_real_cunit.c
+++ b/src/tests/gsb_real_cunit.c
@@ -38,6 +38,7 @@
 /* START_INCLUDE */
 #include "gsb_real_cunit.h"
 #include "gsb_real.h"
+#include "utils_str.h"
 /* END_INCLUDE */
 
 /* START_STATIC */
diff --git a/src/tests/main_cunit.c b/src/tests/main_cunit.c
index cb26bca..25208e7 100644
--- a/src/tests/main_cunit.c
+++ b/src/tests/main_cunit.c
@@ -52,7 +52,6 @@
  */
 GtkWidget *window = NULL;
 struct gsb_run_t run;
-extern FILE *debug_file;
 extern gchar *nom_fichier_comptes;
 gboolean gsb_grisbi_close( void )
 {


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list