aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-17 06:40:50 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-17 06:40:50 +0000
commitd31e57a10ddac0603a44ee5f930ff8b12a039c11 (patch)
tree0382687247c95d222345449f5f9c8b745883e3ec
parent6ba0b46cec38942bfa04ce9fd6379761df38a841 (diff)
downloadriscv-openocd-d31e57a10ddac0603a44ee5f930ff8b12a039c11.zip
riscv-openocd-d31e57a10ddac0603a44ee5f930ff8b12a039c11.tar.gz
riscv-openocd-d31e57a10ddac0603a44ee5f930ff8b12a039c11.tar.bz2
David Brownell <david-b@pacbell.net>:
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
-rw-r--r--src/jtag/core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index a8d65f1..aaa7da1 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;