Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1376)

Unified Diff: sandbox/win/tests/common/controller.cc

Issue 2646043002: Reland "Fix sandbox::PolicyBase leak" (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/win/tests/common/controller.cc
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc
index 6e45e0ef6c5ac78a41797133f5a58580b5fbb03c..0d2973f045afeb464995700be674849963f37fbd 100644
--- a/sandbox/win/tests/common/controller.cc
+++ b/sandbox/win/tests/common/controller.cc
@@ -136,15 +136,12 @@ void TestRunner::Init(JobLevel job_level,
}
TargetPolicy* TestRunner::GetPolicy() {
- return policy_;
+ return policy_.get();
}
TestRunner::~TestRunner() {
if (target_process_.IsValid() && kill_on_destruction_)
::TerminateProcess(target_process_.Get(), 0);
-
- if (policy_)
- policy_->Release();
}
bool TestRunner::AddRule(TargetPolicy::SubSystem subsystem,
@@ -242,10 +239,8 @@ int TestRunner::InternalRunTest(const wchar_t* command) {
result = broker_->SpawnTarget(prog_name, arguments.c_str(), policy_,
&warning_result, &last_error, &target);
}
- if (release_policy_in_run_) {
- policy_->Release();
+ if (release_policy_in_run_)
Will Harris 2017/01/24 19:47:32 note: new change
policy_ = nullptr;
- }
if (SBOX_ALL_OK != result)
return SBOX_TEST_FAILED_TO_RUN_TEST;
« sandbox/win/src/broker_services.cc ('K') | « sandbox/win/tests/common/controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698