setFreeFunc

fun setFreeFunc(proxy: Proxy, owned: Boolean, freeFunc: (<Error class: unknown class>) -> Unit)(source)

Sets a custom cleanup function for the specified Proxy instance.

This function overrides the default cleanup mechanism (g_free).

By default, it also marks the memory as owned (owned = true), so you do not need to call takeOwnership explicitly.

Parameters

proxy

The Proxy instance.

owned

Whether the memory should be owned (default is true).

freeFunc

A lambda function to perform the cleanup.