[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.2-20111231-5-gd68a527)
The branch, master has been updated
via d68a5277f1a4f1ad67a3cd9448b11d1a3dda6d01 (commit)
from 95f48e6f1b8e624ec7d25d9854c97d86d62b50dc (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.
=========
Summary
=========
gschem/src/g_hook.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
=================
Commit Messages
=================
commit d68a5277f1a4f1ad67a3cd9448b11d1a3dda6d01
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: Unbreak most of the dialog boxes.
In commit 78c8ee905dad, OBJECT smobs were altered to store a TOPLEVEL
pointer for use when freeing them during garbage collection. The
TOPLEVEL pointer is obtained using edascm_current_toplevel().
Unfortunately, since edascm_current_toplevel() raises a Scheme error
when the TOPLEVEL fluid is not set, this means that
edascm_from_object() can crash gEDA applications if it is not called
from inside a Scheme catch context *and* the TOPLEVEL fluid isn't set
in the current dynamic context.
This exposed a bug in commit 71cc3eb5583b, where OBJECT smobs were
created *before* setting the TOPLEVEL fluid. As a result, gschem
crashed pretty reliably when hooks were triggered via dialog boxes
rather than via keystrokes or menu item (e.g. when adding attributes
with the "Add Attribute" dialog box). This patch fixes the issue.
:100644 100644 97584e6... e2a37fa... M gschem/src/g_hook.c
=========
Changes
=========
commit d68a5277f1a4f1ad67a3cd9448b11d1a3dda6d01
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: Unbreak most of the dialog boxes.
In commit 78c8ee905dad, OBJECT smobs were altered to store a TOPLEVEL
pointer for use when freeing them during garbage collection. The
TOPLEVEL pointer is obtained using edascm_current_toplevel().
Unfortunately, since edascm_current_toplevel() raises a Scheme error
when the TOPLEVEL fluid is not set, this means that
edascm_from_object() can crash gEDA applications if it is not called
from inside a Scheme catch context *and* the TOPLEVEL fluid isn't set
in the current dynamic context.
This exposed a bug in commit 71cc3eb5583b, where OBJECT smobs were
created *before* setting the TOPLEVEL fluid. As a result, gschem
crashed pretty reliably when hooks were triggered via dialog boxes
rather than via keystrokes or menu item (e.g. when adding attributes
with the "Add Attribute" dialog box). This patch fixes the issue.
diff --git a/gschem/src/g_hook.c b/gschem/src/g_hook.c
index 97584e6..e2a37fa 100644
--- a/gschem/src/g_hook.c
+++ b/gschem/src/g_hook.c
@@ -71,6 +71,10 @@ g_run_hook_object_list (GSCHEM_TOPLEVEL *w_current, const char *name,
{
SCM lst = SCM_EOL;
GList *iter;
+
+ scm_dynwind_begin (0);
+ g_dynwind_window (w_current);
+
for (iter = obj_lst; iter != NULL; iter = g_list_next (iter)) {
lst = scm_cons (edascm_from_object ((OBJECT *) iter->data), lst);
}
@@ -78,8 +82,6 @@ g_run_hook_object_list (GSCHEM_TOPLEVEL *w_current, const char *name,
scm_cons (g_get_hook_by_name (name),
scm_reverse_x (lst, SCM_EOL)));
- scm_dynwind_begin (0);
- g_dynwind_window (w_current);
g_scm_eval_protected (expr, scm_interaction_environment ());
scm_dynwind_end ();
scm_remember_upto_here_1 (expr);
@@ -98,12 +100,13 @@ g_run_hook_object_list (GSCHEM_TOPLEVEL *w_current, const char *name,
void
g_run_hook_object (GSCHEM_TOPLEVEL *w_current, const char *name, OBJECT *obj)
{
+ scm_dynwind_begin (0);
+ g_dynwind_window (w_current);
+
SCM expr = scm_list_3 (run_hook_sym,
g_get_hook_by_name (name),
scm_list_1 (edascm_from_object (obj)));
- scm_dynwind_begin (0);
- g_dynwind_window (w_current);
g_scm_eval_protected (expr, scm_interaction_environment ());
scm_dynwind_end ();
scm_remember_upto_here_1 (expr);
@@ -120,12 +123,13 @@ g_run_hook_object (GSCHEM_TOPLEVEL *w_current, const char *name, OBJECT *obj)
void
g_run_hook_page (GSCHEM_TOPLEVEL *w_current, const char *name, PAGE *page)
{
+ scm_dynwind_begin (0);
+ g_dynwind_window (w_current);
+
SCM expr = scm_list_3 (run_hook_sym,
g_get_hook_by_name (name),
edascm_from_page (page));
- scm_dynwind_begin (0);
- g_dynwind_window (w_current);
g_scm_eval_protected (expr, scm_interaction_environment ());
scm_dynwind_end ();
scm_remember_upto_here_1 (expr);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs