summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/array_output.cc
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 07:10:58 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 07:10:58 +0000
commit7ac673b55f9c2334d531c280f907e2d0edaed68b (patch)
tree1dbb373bcfb3cd61836fe17a3f1807f7aaf36ec5 /ppapi/cpp/array_output.cc
parent88f11549025ad46da215d208a016387619d7271d (diff)
downloadchromium_src-7ac673b55f9c2334d531c280f907e2d0edaed68b.zip
chromium_src-7ac673b55f9c2334d531c280f907e2d0edaed68b.tar.gz
chromium_src-7ac673b55f9c2334d531c280f907e2d0edaed68b.tar.bz2
Change the cpp wrappers of audio input/video capture to use CompletionCallbackWithOutput.
And also fix a few bugs in the PP_ArrayOutput and CallbackWithOutput code. - Make sure POD members of Dispatcher\.* are properly initialized. - Avoid leaking var/resource references in DispatcherWithOutput\.*::operator(). BUG=None TEST=None Review URL: http://codereview.chromium.org/9965080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/array_output.cc')
-rw-r--r--ppapi/cpp/array_output.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/ppapi/cpp/array_output.cc b/ppapi/cpp/array_output.cc
index 4cb8c85..62252f7 100644
--- a/ppapi/cpp/array_output.cc
+++ b/ppapi/cpp/array_output.cc
@@ -21,6 +21,13 @@ VarArrayOutputAdapterWithStorage::VarArrayOutputAdapterWithStorage()
set_output(&temp_storage_);
}
+VarArrayOutputAdapterWithStorage::~VarArrayOutputAdapterWithStorage() {
+ if (!temp_storage_.empty()) {
+ // An easy way to release the var references held by this object.
+ output();
+ }
+}
+
std::vector<Var>& VarArrayOutputAdapterWithStorage::output() {
PP_DCHECK(output_storage_.empty());