Skip to content

Commit cade278

Browse files
committed
cleanup
1 parent 66a1e8b commit cade278

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

telemetry.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ type accTelemetry struct {
1515
graphicsData *accDataHolder[AccGraphic]
1616
}
1717

18+
type accDataHolder[T AccGraphic | AccPhysics | AccStatic] struct {
19+
mmap *mmap
20+
data *T
21+
}
22+
23+
func (d *accDataHolder[T]) Close() error {
24+
if d.mmap != nil {
25+
d.mmap.Close()
26+
d.mmap = nil
27+
}
28+
d.data = nil
29+
return nil
30+
}
31+
1832
func (t *accTelemetry) Connect() error {
1933
var accStatic AccStatic
2034
staticMMap, err := mapFile(STATIC_FILE_MMAP, unsafe.Sizeof(accStatic))

type_holder.go

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)