diff options
author | John Koleszar <jkoleszar@google.com> | 2012-07-13 17:11:21 -0700 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2012-07-13 17:14:18 -0700 |
commit | 4d3c3be6ba744614bf7035eb87bd4c76a1fb92c4 (patch) | |
tree | 9185f31adc88b242dd1d1548b1c0478678251229 /examples/twopass_encoder.txt | |
parent | a6f4fc5a93be96700eb53d2b70b498a8c28edf97 (diff) | |
download | libvpx-4d3c3be6ba744614bf7035eb87bd4c76a1fb92c4.tar libvpx-4d3c3be6ba744614bf7035eb87bd4c76a1fb92c4.tar.gz libvpx-4d3c3be6ba744614bf7035eb87bd4c76a1fb92c4.tar.bz2 libvpx-4d3c3be6ba744614bf7035eb87bd4c76a1fb92c4.zip |
examples: fix memory leak
Free used resources before exiting.
Change-Id: If6cde6541615fbf17bf56ed335b76e676eabba93
Diffstat (limited to 'examples/twopass_encoder.txt')
-rw-r--r-- | examples/twopass_encoder.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/twopass_encoder.txt b/examples/twopass_encoder.txt index 4683bc708..2f81a9018 100644 --- a/examples/twopass_encoder.txt +++ b/examples/twopass_encoder.txt @@ -71,5 +71,17 @@ Pass Progress Reporting It's sometimes helpful to see when each pass completes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END printf("Pass %d complete.\n", pass+1); + if(vpx_codec_destroy(&codec)) + die_codec(&codec, "Failed to destroy codec"); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END + + +Clean-up +----------------------------- +Destruction of the encoder instance must be done on each pass. The +raw image should be destroyed at the end as usual. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY +vpx_img_free(&raw); +free(stats.buf); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY |