[goffice] Don't crash when loading a corrupted chart. [#626305]



commit f8a42de9252045ad63539c27895484a577e727b5
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Aug 7 18:30:08 2010 +0200

    Don't crash when loading a corrupted chart. [#626305]

 ChangeLog                  |    5 +++++
 NEWS                       |    2 +-
 goffice/graph/gog-object.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0feed1c..9dc28f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-08-07  Jean Brefort  <jean brefort normalesup org>
 
+	* goffice/graph/gog-object.c (gog_object_add_by_role): do not try to
+	instantiate an object uising an abstract class. [#626305]
+
+2010-08-07  Jean Brefort  <jean brefort normalesup org>
+
 	* goffice/graph/gog-data-set.c (gog_dataset_set_dim): check dimension.
 	* goffice/graph/gog-object-xml.c (gogo_dim_start):  check dimension and
 	object type [#626263],
diff --git a/NEWS b/NEWS
index 9aede36..a6eb3e2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 goffice 0.8.9:
 
 Jean:
-	* Don't crash when loading a corrupted chart. [#626206, #626263]
+	* Don't crash when loading a corrupted chart. [#626206, #626263, #626305]
 
 --------------------------------------------------------------------------
 goffice 0.8.8:
diff --git a/goffice/graph/gog-object.c b/goffice/graph/gog-object.c
index 141c8c0..5500f69 100644
--- a/goffice/graph/gog-object.c
+++ b/goffice/graph/gog-object.c
@@ -1546,7 +1546,7 @@ gog_object_add_by_role (GogObject *parent, GogObjectRole const *role, GogObject
 	if (child == NULL) {
 		child = (role->allocate)
 			? (role->allocate) (parent)
-			: g_object_new (is_a, NULL);
+			: (G_TYPE_IS_ABSTRACT (is_a)? NULL: g_object_new (is_a, NULL));
 
 		/* g_object_new or the allocator have already generated an
 		 * error message, just exit */



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