Gck.Attributes.prototype.ref_sink

function ref_sink(): Gck.Attributes {
    // Gjs wrapper for gck_attributes_ref_sink()
}
  

Gck.Attributes uses a floating reference count system. Gck.Builder.prototype.end and Gck.Attributes.new_empty both return floating references.

Calling Gck.Attributes.prototype.ref_sink on a Gck.Attributes with a floating reference will convert the floating reference into a full reference. Calling Gck.Attributes.prototype.ref_sink on a non-floating Gck.Attributes results in an additional normal reference being added.

In other words, if the attrs is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference. If the attrs is not floating, then this call adds a new normal reference increasing the reference count by one.

All Gck library functions that assume ownership of floating references are documented as such. Essentially any Gck function that performs an operation using a Gck.Attributes argument rather than operating on the atributes themselves, will accept a floating reference.

Returns

the referenced attributes