mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-01-23 02:48:11 -05:00
fix(ui): memory leak when getting image DTO
must unsubscribe!
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user