forked from enlightenment/efl
csharp: Suppress CA2000 in native wrappers.
Summary: These methods may instantiate `IDisposable` classes like `Array`, `Iterator` to pass to user-overriden C# methods. As we can't guarantee the user stored the object or not, we can't call Dispose directly on them. Ref T8423 Depends on D10670 Reviewers: brunobelo, felipealmeida, YOhoho Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8423 Differential Revision: https://phab.enlightenment.org/D10671
This commit is contained in:
parent
fe8496cb6e
commit
a0dd0b616a
|
@ -123,7 +123,8 @@ struct native_function_definition_generator
|
||||||
self = "";
|
self = "";
|
||||||
|
|
||||||
if(!as_generator
|
if(!as_generator
|
||||||
(indent << "private static "
|
(indent << "[SuppressMessage(\"Microsoft.Reliability\", \"CA2000:DisposeObjectsBeforeLosingScope\", Justification = \"The instantiated objects can be stored in the called Managed API method.\")]\n"
|
||||||
|
<< indent << "private static "
|
||||||
<< eolian_mono::marshall_type(true) << " "
|
<< eolian_mono::marshall_type(true) << " "
|
||||||
<< string
|
<< string
|
||||||
<< "(System.IntPtr obj, System.IntPtr pd"
|
<< "(System.IntPtr obj, System.IntPtr pd"
|
||||||
|
|
|
@ -171,7 +171,8 @@ run(options_type const& opts)
|
||||||
"using System.Collections.Generic;\n"
|
"using System.Collections.Generic;\n"
|
||||||
"using System.Linq;\n"
|
"using System.Linq;\n"
|
||||||
"using System.Threading;\n"
|
"using System.Threading;\n"
|
||||||
"using System.ComponentModel;\n")
|
"using System.ComponentModel;\n"
|
||||||
|
"using System.Diagnostics.CodeAnalysis;\n")
|
||||||
.generate(iterator, efl::eolian::grammar::attributes::unused, efl::eolian::grammar::context_null()))
|
.generate(iterator, efl::eolian::grammar::attributes::unused, efl::eolian::grammar::context_null()))
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Failed to generate file preamble");
|
throw std::runtime_error("Failed to generate file preamble");
|
||||||
|
|
Loading…
Reference in New Issue