diff --git a/hw/darwin/quartz/xpr/x-hook.c b/hw/darwin/quartz/xpr/x-hook.c index 2d9a564d6..84bf44416 100644 --- a/hw/darwin/quartz/xpr/x-hook.c +++ b/hw/darwin/quartz/xpr/x-hook.c @@ -50,19 +50,12 @@ X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data) { x_list *node, *cell; x_list *to_delete = NULL; - x_list *prev = NULL; - for (node = lst; node != NULL; prev = node, node = node->next) + for (node = lst; node != NULL; node = node->next) { cell = node->data; if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data) - { to_delete = X_PFX (list_prepend) (to_delete, cell); - if(lst == node) - lst = node->next; - else - prev->next = node->next; - } } for (node = to_delete; node != NULL; node = node->next)