mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-02 20:26:59 +01:00
Fix memory leak due to CToCpp argument lists not being deleted (issue #526).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@491 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
55b363354f
commit
ce0eb1c92b
@ -154,6 +154,10 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||
dirtyRectsCount,
|
||||
dirtyRectsList,
|
||||
buffer);
|
||||
|
||||
// Restore param:dirtyRects; type: simple_vec_byref_const
|
||||
if (dirtyRectsList)
|
||||
delete [] dirtyRectsList;
|
||||
}
|
||||
|
||||
void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||
|
@ -60,6 +60,9 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name,
|
||||
&retvalStruct,
|
||||
exception.GetWritableStruct());
|
||||
|
||||
// Restore param:arguments; type: refptr_vec_diff_byref_const
|
||||
if (argumentsList)
|
||||
delete [] argumentsList;
|
||||
// Restore param:retval; type: refptr_diff_byref
|
||||
if (retvalStruct) {
|
||||
if (retvalStruct != retvalOrig) {
|
||||
|
@ -700,6 +700,9 @@ bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr<CefV8Value> object,
|
||||
&exceptionStruct,
|
||||
rethrow_exception);
|
||||
|
||||
// Restore param:arguments; type: refptr_vec_same_byref_const
|
||||
if (argumentsList)
|
||||
delete [] argumentsList;
|
||||
// Restore param:retval; type: refptr_same_byref
|
||||
if (retvalStruct) {
|
||||
if (retvalStruct != retvalOrig) {
|
||||
@ -769,6 +772,9 @@ bool CefV8ValueCToCpp::ExecuteFunctionWithContext(
|
||||
&exceptionStruct,
|
||||
rethrow_exception);
|
||||
|
||||
// Restore param:arguments; type: refptr_vec_same_byref_const
|
||||
if (argumentsList)
|
||||
delete [] argumentsList;
|
||||
// Restore param:retval; type: refptr_same_byref
|
||||
if (retvalStruct) {
|
||||
if (retvalStruct != retvalOrig) {
|
||||
|
@ -377,6 +377,11 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
||||
'\n }'\
|
||||
'\n delete [] '+arg_name+'List;'\
|
||||
'\n }'
|
||||
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
||||
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const':
|
||||
result += comment+\
|
||||
'\n if ('+arg_name+'List)'\
|
||||
'\n delete [] '+arg_name+'List;'
|
||||
|
||||
if len(result) != result_len:
|
||||
result += '\n'
|
||||
|
@ -1,7 +1,7 @@
|
||||
Chromium Embedded Framework (CEF) Translator Tool -- translator.py
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Document Last Updated: December 7, 2011
|
||||
Document Last Updated: February 14, 2012
|
||||
|
||||
|
||||
OVERVIEW
|
||||
@ -1164,6 +1164,10 @@ Parameters:
|
||||
|
||||
// Execution
|
||||
cef_function(valueCount, valueList);
|
||||
|
||||
// Parameter Restoration
|
||||
if (valueList)
|
||||
delete [] valueList;
|
||||
}
|
||||
|
||||
Boolean vector non-const type by reference (bool_vec_byref):
|
||||
@ -1270,6 +1274,10 @@ Parameters:
|
||||
|
||||
// Execution
|
||||
cef_function(valueCount, valueList);
|
||||
|
||||
// Parameter Restoration
|
||||
if (valueList)
|
||||
delete [] valueList;
|
||||
}
|
||||
|
||||
Smart pointer vector non-const type same boundary side by reference
|
||||
@ -1380,6 +1388,10 @@ Parameters:
|
||||
|
||||
// Execution
|
||||
cef_function(valueCount, valueList);
|
||||
|
||||
// Parameter Restoration
|
||||
if (valueList)
|
||||
delete [] valueList;
|
||||
}
|
||||
|
||||
Smart pointer vector non-const type different boundary side by reference
|
||||
@ -1490,6 +1502,10 @@ Parameters:
|
||||
|
||||
// Execution
|
||||
cef_function(valueCount, valueList);
|
||||
|
||||
// Parameter Restoration
|
||||
if (valueList)
|
||||
delete [] valueList;
|
||||
}
|
||||
|
||||
Return Values:
|
||||
|
Loading…
x
Reference in New Issue
Block a user