Hi,
when we merge some xlsx files or copy some cells,memory leak occurs in some application scenarios.
// PushCell adds a predefiend cell to the end of the Row
func (r *Row) PushCell(c *Cell) {
r.cellStoreRow.Updatable()
r.isCustom = true
r.cellStoreRow.PushCell(c)
// c.Row Still only points to the original Row.
// c.Row -> c.Row.Sheet -> c.Row.Sheet.File , then blocks GC
}
we recommand adding a new function CopyCell :
// CopyCell adds a predefiend cell to the end of the Row
func (r *Row) CopyCell(c *Cell) {
r.cellStoreRow.Updatable()
r.isCustom = true
c.Row = r // Release the reference to the original row,points to the target Row
r.cellStoreRow.PushCell(c)
}
Hi, when we merge some xlsx files or copy some cells,memory leak occurs in some application scenarios.
we recommand adding a new function CopyCell :