skia2/experimental/c-api-example
Petar Kirov 1ff585637a Fix small memory leak in c-api example
While working on creating bindings for dlang, I noticed that there was a
missing call to `sk_imageinfo_delete`, corresponding to the call to
`sk_imageinfo_new` in the c-api example. At first I thought that
`sk_surface_new_raster` (or something else) would free the image info
object internally, but after checking the implementation I saw this was
not the case.

This can be trivially verified with valgrind:

Before this change:
    $ valgrind ./skia-c-example 2>&1 | grep 'definitely lost'
    ==186215==    definitely lost: 24 bytes in 1 blocks

After:
    $ valgrind ./skia-c-example 2>&1 | grep 'definitely lost'
    ==185878==    definitely lost: 0 bytes in 0 blocks

Test: built and ran skia-c-example.c under valgrind
Change-Id: Ie3fba2e7602341d2f5e7dac198b3ec5923777cbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260021
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-12-16 16:03:04 +00:00
..
c.md bin/sysopen: script moved to bin 2018-12-06 14:21:33 +00:00
skia-c-example.c Fix small memory leak in c-api example 2019-12-16 16:03:04 +00:00