Just to confirm: You mean storing the pointer to the libcairo allocated memory in e.g. surf.ptr?
Can you please point to an example where it’s done correctly?
i can see the output (pointer to cairo_surface) as an adress, the same as an input to cairo_surface_destroy. This is also how i founded my (false) theory on GC freeing, i set a watchpoint to that adress and found ‘free’ as the function applied to it.
Again, for confirmation: Storing the pointers to libcairo structures?