X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=ui%2Fcommon%2Fdiscover-client.c;h=8672ae019d54f3e2121742cdfb125908e5be3059;hp=7c2e27daa777a4ddbb8cb4e4063b090c70e8cc52;hb=1bb9ed4ffbbd1b186b30702d3c4104d5597d0888;hpb=f5192075ca25e91ae72f12c89cab0c9c66eb6606 diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index 7c2e27d..8672ae0 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include "ui/common/discover-client.h" #include "pb-protocol/pb-protocol.h" @@ -107,10 +107,6 @@ static void remove_device(struct discover_client *client, const char *id) if (!device) return; - client->ops.remove_device(device, client->ops.cb_arg); - - talloc_free(device); - /* remove the device from the client's device array */ client->n_devices--; memmove(&client->devices[i], &client->devices[i+1], @@ -118,6 +114,10 @@ static void remove_device(struct discover_client *client, const char *id) client->devices = talloc_realloc(client, client->devices, struct device *, client->n_devices); + /* notify the UI */ + client->ops.remove_device(device, client->ops.cb_arg); + + talloc_free(device); } int discover_client_process(struct discover_client *client)