From d31e57a10ddac0603a44ee5f930ff8b12a039c11 Mon Sep 17 00:00:00 2001 From: zwelch Date: Wed, 17 Jun 2009 06:40:50 +0000 Subject: [PATCH] David Brownell : Let jtag_call_event_callbacks() behave when the callback removes itself. Oddly, this crashed on x86_32 but not x86_64. git-svn-id: svn://svn.berlios.de/openocd/trunk@2264 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jtag/core.c b/src/jtag/core.c index a8d65f1e..aaa7da1f 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -282,8 +282,12 @@ int jtag_call_event_callbacks(enum jtag_event event) while (callback) { + jtag_event_callback_t *next; + + /* callback may remove itself */ + next = callback->next; callback->callback(event, callback->priv); - callback = callback->next; + callback = next; } return ERROR_OK; -- 2.39.5