Index: ppapi/cpp/array_output.cc |
diff --git a/ppapi/cpp/array_output.cc b/ppapi/cpp/array_output.cc |
index 4cb8c857b23b0184363422eea3d9d67fd4175531..62252f72562d5d4bd5fc3cbc06b2d861ac72ccce 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()); |