Skip to content

Commit

Permalink
fix: dispose line material (#2039)
Browse files Browse the repository at this point in the history
  • Loading branch information
caesar1030 authored Jul 22, 2024
1 parent 1e38df3 commit 816650a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/Line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export const Line: ForwardRefComponent<LineProps, Line2 | LineSegments2> = /* @_
}, [dashed, lineMaterial])

React.useEffect(() => {
return () => lineGeom.dispose()
return () => {
lineGeom.dispose()
lineMaterial.dispose()
}
}, [lineGeom])

return (
Expand Down

0 comments on commit 816650a

Please sign in to comment.