Skip to content

Commit

Permalink
add some TODOs to methods that still need an Unreffing finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
RSWilli committed Jun 24, 2024
1 parent 32b98b5 commit 6f735e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions glib/gfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (v *File) Read(cancellable *Cancellable) (*FileInputStream, error) {
defer C.g_error_free(gerr)
return nil, errors.New(goString(gerr.message))
}
// TODO: use a finalizer here, so the caller wont have to Unref()
return wrapFileInputStream(Take(unsafe.Pointer(c))), nil
}

Expand Down
1 change: 1 addition & 0 deletions glib/gobjectclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (o *ObjectClass) ListProperties() []*ParamSpec {
out := make([]*ParamSpec, 0)

for _, prop := range (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.GParamSpec)(nil))]*C.GParamSpec)(unsafe.Pointer(props))[:size:size] {
// TODO: use a finialized version that does not require an Unref
out = append(out, ToParamSpec(unsafe.Pointer(prop)))
}
return out
Expand Down

0 comments on commit 6f735e0

Please sign in to comment.