Skip to content

Commit 480bf87

Browse files
committed
fix: Address memory leaks in ChatView (ChatView_1113, ChatView_1236)
1 parent 5a4c93d commit 480bf87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
159159
clineAskRef.current = clineAsk
160160
}, [clineAsk])
161161

162+
useEffect(() => {
163+
isMountedRef.current = true
164+
return () => {
165+
isMountedRef.current = false
166+
}
167+
}, [])
168+
162169
const isProfileDisabled = useMemo(
163170
() => !!apiConfiguration && !ProfileValidator.isProfileAllowed(apiConfiguration, organizationAllowList),
164171
[apiConfiguration, organizationAllowList],

0 commit comments

Comments
 (0)