[anjuta] bgo #633018 crash in Anjuta IDE: miuse of xmlCleanupParser



commit 28b459a345dd8e0fe6ccd137534211e69813de53
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sat Dec 25 15:21:37 2010 +0100

    bgo #633018 crash in Anjuta IDE: miuse of xmlCleanupParser

 libanjuta/anjuta-profile-manager.c          |    2 --
 plugins/document-manager/anjuta-bookmarks.c |    1 -
 plugins/language-manager/plugin.c           |    1 -
 src/Makefile.am                             |    4 +++-
 src/main.c                                  |    6 +++++-
 5 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/libanjuta/anjuta-profile-manager.c b/libanjuta/anjuta-profile-manager.c
index 6c275f4..241e512 100644
--- a/libanjuta/anjuta-profile-manager.c
+++ b/libanjuta/anjuta-profile-manager.c
@@ -35,8 +35,6 @@
  */
 
 #include <string.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
 
 #include <libanjuta/anjuta-debug.h>
 #include <libanjuta/anjuta-marshal.h>
diff --git a/plugins/document-manager/anjuta-bookmarks.c b/plugins/document-manager/anjuta-bookmarks.c
index 2fd7e2a..63d58aa 100644
--- a/plugins/document-manager/anjuta-bookmarks.c
+++ b/plugins/document-manager/anjuta-bookmarks.c
@@ -845,7 +845,6 @@ anjuta_bookmarks_session_load (AnjutaBookmarks* bookmarks, AnjutaSession* sessio
 		read_bookmarks (bookmarks, cur->children);
 	
 	xmlFreeDoc (doc);
-	xmlCleanupParser();
 }
 
 static gint
diff --git a/plugins/language-manager/plugin.c b/plugins/language-manager/plugin.c
index 88d98bd..4a0ca73 100644
--- a/plugins/language-manager/plugin.c
+++ b/plugins/language-manager/plugin.c
@@ -130,7 +130,6 @@ load_languages (LanguageManager* language_manager)
 		g_free (strings);
 	}	
 	xmlFreeDoc(doc);
-	xmlCleanupParser();
 }
 
 static gboolean
diff --git a/src/Makefile.am b/src/Makefile.am
index d570501..7cbf0e8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -20,6 +20,7 @@ AM_CPPFLAGS = \
 	-I.. -I. \
 	$(LIBANJUTA_CFLAGS) \
 	$(GDL_CFLAGS) \
+	$(XML_CFLAGS) \
 	-DPACKAGE_BIN_DIR=\"$(bindir)\" \
 	-DPACKAGE_DATA_DIR="\"$(datadir)/$(PACKAGE)\"" \
 	-DPACKAGE_DOC_DIR=\"$(docdir)\" \
@@ -45,7 +46,8 @@ anjuta_SOURCES = \
 anjuta_LDADD =  \
 	$(ANJUTA_LIBS) \
 	$(GDL_LIBS) \
-	$(LIBANJUTA_LIBS)
+	$(LIBANJUTA_LIBS) \
+	$(XML_LIBS)
 
 anjuta_LDFLAGS = $(ANJUTA_LDFLAGS)
 
diff --git a/src/main.c b/src/main.c
index ea3881c..0212b63 100644
--- a/src/main.c
+++ b/src/main.c
@@ -31,6 +31,7 @@
 
 #include <gtk/gtk.h>
 #include <libanjuta/anjuta-debug.h>
+#include <libxml/parser.h>
 
 #include "anjuta.h"
 
@@ -203,6 +204,9 @@ main (int argc, char *argv[])
 	
 	status = g_application_run (G_APPLICATION (anjuta), argc, argv);
 	g_object_unref (anjuta);
-	
+
+	/* xmlCleanupParser must be called only one time in the application */
+	if (proper_shutdown) xmlCleanupParser ();
+
 	return status;
 }



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