Skip to content

Commit d0c6b32

Browse files
committed
fix: attempt to fix memory leak
1 parent a866a9a commit d0c6b32

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

ui/components/issuessection/issuessection.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ func (m Model) GetTotalCount() *int {
405405
if m.IsLoading() {
406406
return nil
407407
}
408-
return &m.TotalCount
408+
c := m.TotalCount
409+
return &c
409410
}
410411

411412
func (m Model) IsLoading() bool {

ui/components/prssection/prssection.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ func (m Model) Update(msg tea.Msg) (section.Section, tea.Cmd) {
175175
m.Table.SetRows(m.BuildRows())
176176
m.Table.UpdateLastUpdated(time.Now())
177177
m.UpdateTotalItemsCount(m.TotalCount)
178+
178179
}
179180
}
180181

@@ -502,7 +503,8 @@ func (m Model) GetTotalCount() *int {
502503
if m.IsLoading() {
503504
return nil
504505
}
505-
return &m.TotalCount
506+
c := m.TotalCount
507+
return &c
506508
}
507509

508510
func (m Model) IsLoading() bool {

ui/components/reposection/reposection.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ func (m *Model) GetTotalCount() *int {
554554
return nil
555555
}
556556

557-
return utils.IntPtr(len(m.Branches))
557+
c := len(m.Branches)
558+
return &c
558559
}
559560

560561
func (m *Model) SetIsLoading(val bool) {

0 commit comments

Comments
 (0)