Skip to content

Commit 00a614f

Browse files
Dispose of Async instance to prevent memory leak
1 parent 873aa00 commit 00a614f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/controls/sitePicker/SitePicker.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ const styles = mergeStyleSets({
6767
},
6868
});
6969

70-
const async = new Async();
70+
useEffect(() => {
71+
return () => {
72+
async.dispose();
73+
};
74+
}, []);
7175

7276
export const SitePicker: React.FunctionComponent<ISitePickerProps> = (
7377
props: React.PropsWithChildren<ISitePickerProps>

0 commit comments

Comments
 (0)