Commit f31c4008 authored by John Koleszar's avatar John Koleszar Committed by Gerrit Code Review
Browse files

Merge "examples: fix memory leak"

parents 7f009975 4d3c3be6
......@@ -68,6 +68,7 @@ case VPX_CODEC_CX_FRAME_PKT:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
vpx_img_free(&raw);
if(vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment