Leaking WebGLRenderer when rerendering on iOS

I have created a react-three-fiber web-app which uses webgl canvas. When the canvas is forced to rerender due to external change, a new canvas context is being created and the previous one is not lost. This leads to safari refresh and crash as the no of active canvas contexts goes beyond the max limit alongwith the memory. This issue is specific to Safari only and (chrome only on iOS). Does Safari have a different garbage collection mechanism and not include webgl context clear automatically? If it doesnt, is there an API to invoke the same?