Custom Emoji: Fix memory leak when closing chat with draft (#4475)
This commit is contained in:
parent
fd6549ed1d
commit
3c4196679a
@ -132,6 +132,14 @@ export default function useInputCustomEmojis(
|
||||
return addCustomEmojiInputRenderCallback(synchronizeElements);
|
||||
}, [synchronizeElements]);
|
||||
|
||||
useEffect(() => {
|
||||
const activePlayersById = playersById.current;
|
||||
// Always clear players on unmount
|
||||
return () => {
|
||||
clearPlayers(Array.from(activePlayersById.keys()));
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!getHtml() || !inputRef.current || !sharedCanvasRef.current || !isActive || !isReady) {
|
||||
clearPlayers(Array.from(playersById.current.keys()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user