Skip to content

Use destructors for automaticaly closing of resources #13

@planetis-m

Description

@planetis-m

in order to do these are the steps that need to be taken:

  1. types and procs interfacing directly with libcairo need to keep their original names
    example type example proc

  2. The "higher level" user api of this library will get shorter names like Surface, imageSurfaceCreate.

  3. destructors will be attached to these types. it will look like this:

type
  Surface = object
    data: PSurface

`=destroy`(surface: var Surface)
`=`(dst: var Surface, src: Surface) {.error.}

These changes will break the api of this library but will allow the user to forget the closing of resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions