mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): memory leak when getting image DTO
must unsubscribe!
This commit is contained in:
parent
82f0cb2c8c
commit
5aa2957da4
@ -580,8 +580,11 @@ export const getImageDTO = async (image_name: string, forceRefetch?: boolean): P
|
||||
};
|
||||
const req = getStore().dispatch(imagesApi.endpoints.getImageDTO.initiate(image_name, options));
|
||||
try {
|
||||
return await req.unwrap();
|
||||
const imageDTO = await req.unwrap();
|
||||
req.unsubscribe();
|
||||
return imageDTO;
|
||||
} catch {
|
||||
req.unsubscribe();
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user