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

Unified Diff: fxjs/cfxjse_class.cpp

Issue 2328273004: Fix leaked value object in NamedPropertySetterCallback() (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjs/cfxjse_class.cpp
diff --git a/fxjs/cfxjse_class.cpp b/fxjs/cfxjse_class.cpp
index de22af7681798e933f06017f2524c04c184cca3f..6ccc0e2e240a7711af0432a46de39154eacf29af 100644
--- a/fxjs/cfxjse_class.cpp
+++ b/fxjs/cfxjse_class.cpp
@@ -289,9 +289,10 @@ void NamedPropertySetterCallback(
new CFXJSE_Value(info.GetIsolate()));
lpThisValue->ForceSetValue(thisObject);
- CFXJSE_Value* lpNewValue = new CFXJSE_Value(info.GetIsolate());
+ std::unique_ptr<CFXJSE_Value> lpNewValue(new CFXJSE_Value(info.GetIsolate()));
lpNewValue->ForceSetValue(value);
- DynPropSetterAdapter(lpClass, lpThisValue.get(), szFxPropName, lpNewValue);
+ DynPropSetterAdapter(lpClass, lpThisValue.get(), szFxPropName,
+ lpNewValue.get());
info.GetReturnValue().Set(value);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698