Delete line created using buffergeometry

Hi, I am creating the polygon using array of points using following code:

var lineGeometry = new THREE.BufferGeometry();
lineGeometry.addAttribute('position', new THREE.BufferAttribute(pointsArray, 3));
// material
var lineMaterial = new THREE.LineBasicMaterial({
    color: 0x2f58d3,
    linewidth: 2

// line
line = new THREE.Line(lineGeometry, lineMaterial);


I need to remove all the meshes including polygon if user clicks on clear button. I am using below code for doing this. It is doing the job for three js meshes however polygons drawn using buffergeometry and line is not deleted. Any help would be appriciated.

for (var i = 0; i < meshesFoorDesign.length; i++) {
            var sceneMesh = meshesFoorDesign[i];

             if (typeof (sceneMesh) == "undefined")

Version : 103

I’m afraid I’m unable to reproduce the issue with this live example:

Removing the lines works fine with R103 and R109(latest version).

Can you modify the live example in order to demonstrate the issue?