[dia] Bug 780316 - element.c: Set free attribute != NULL



commit 36484ec09147fe39c1c86cb688e878b8bde0bd68
Author: Rodolphe Peccatte <rodolphe_peccatte hotmail com>
Date:   Mon Mar 27 16:08:23 2017 +0200

    Bug 780316 - element.c: Set free attribute != NULL
    
    Commit 37fc9e52 set no free function to an ObjectChange attribute.
    
    It seems that in some circumstances Dia crashes when using Simple Scale
    tool (in the Objects menu) because the python script (scascale.py) tries
    to call an undefined free function.
    
    To prevent this issue, we set the free attribute of the object_change
    attribute to g_free instead of the original NULL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780316

 lib/element.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/element.c b/lib/element.c
index 057dcbb9..35053824 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -503,7 +503,7 @@ element_change_new (const Point *corner,
 
   ec->object_change.apply  = _element_change_swap;
   ec->object_change.revert = _element_change_swap;
-  ec->object_change.free = NULL;
+  ec->object_change.free = (ObjectChangeFreeFunc) g_free;
 
   ec->element = elem;
   ec->corner = elem->corner;


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