diff --git a/lua/cairo.pkg b/lua/cairo.pkg index b68caa30..263406c0 100644 --- a/lua/cairo.pkg +++ b/lua/cairo.pkg @@ -61,6 +61,7 @@ typedef struct _cairo_matrix { double x0; double y0; static tolua_outside cairo_matrix_t* create_cairo_matrix_t @ create(); + static tolua_outside void destroy_cairo_matrix_t @ destroy(cairo_matrix_t *pointer); } cairo_matrix_t; typedef int cairo_bool_t; @@ -410,6 +411,7 @@ typedef struct { double x_advance; double y_advance; static tolua_outside cairo_text_extents_t* create_cairo_text_extents_t @ create(); + static tolua_outside void destroy_cairo_text_extents_t @ destroy(cairo_text_extents_t *pointer); } cairo_text_extents_t; typedef struct { @@ -419,6 +421,7 @@ typedef struct { double max_x_advance; double max_y_advance; static tolua_outside cairo_font_extents_t* create_cairo_font_extents_t @ create(); + static tolua_outside void destroy_cairo_font_extents_t @ destroy(cairo_font_extents_t *pointer); } cairo_font_extents_t; typedef enum _cairo_font_slant { diff --git a/lua/libcairo-helper.h b/lua/libcairo-helper.h index 3b8dce37..7f5cb152 100644 --- a/lua/libcairo-helper.h +++ b/lua/libcairo-helper.h @@ -39,4 +39,17 @@ cairo_matrix_t *create_cairo_matrix_t(void) { return calloc(1, sizeof(cairo_matrix_t)); } +void destroy_cairo_text_extents_t(cairo_text_extents_t *pointer) { + free(pointer); +} + +void destroy_cairo_font_extents_t(cairo_font_extents_t *pointer) { + free(pointer); +} + +void destroy_cairo_matrix_t(cairo_matrix_t *pointer) { + free(pointer); +} + + #endif /* _LIBCAIRO_HELPER_H_ */