diff options
author | bbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-07 22:56:04 +0000 |
---|---|---|
committer | bbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-07 22:56:04 +0000 |
commit | 6308200c0c46e198301347ecbe43d703aef7bea6 (patch) | |
tree | 4fbc410e5440f9d284a578dba8980ce49140c509 /ppapi | |
parent | c7a0cb9b1352c28a9372c4ca25fc88ac5ae1903a (diff) | |
download | chromium_src-6308200c0c46e198301347ecbe43d703aef7bea6.zip chromium_src-6308200c0c46e198301347ecbe43d703aef7bea6.tar.gz chromium_src-6308200c0c46e198301347ecbe43d703aef7bea6.tar.bz2 |
Make PPAPI tests call the destructor for TestCase. TestingInstance constructs a TestCase but never calls the destructor. In the case of TestScrollbar, this causes a surf-away ASSERT because the per-instance objects remain in the global map. A simple fix is to define a virtual destructor for TestingInstance, and in the base implementation, call the destructor for the current TestCase, if any.
BUG=85141
TEST=PPAPITests
Review URL: http://codereview.chromium.org/7064048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/tests/testing_instance.cc | 5 | ||||
-rw-r--r-- | ppapi/tests/testing_instance.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc index 0c322e3..87022bb 100644 --- a/ppapi/tests/testing_instance.cc +++ b/ppapi/tests/testing_instance.cc @@ -24,6 +24,11 @@ TestingInstance::TestingInstance(PP_Instance instance) callback_factory_.Initialize(this); } +TestingInstance::~TestingInstance() { + if (current_case_) + delete current_case_; +} + bool TestingInstance::Init(uint32_t argc, const char* argn[], const char* argv[]) { diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h index 5bb95ae..2201e13 100644 --- a/ppapi/tests/testing_instance.h +++ b/ppapi/tests/testing_instance.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,6 +15,7 @@ class TestCase; class TestingInstance : public pp::Instance { public: explicit TestingInstance(PP_Instance instance); + virtual ~TestingInstance(); // pp::Instance override. virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); |