Fix #2957375 (C#) - SWIGStringHelper and SWIGExceptionHelper not always being initialized before use in .NET 4 as the intermediary class was not marked as beforefieldinit.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12044 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a363a0361b
commit
a4febe7799
2 changed files with 24 additions and 0 deletions
|
|
@ -1,6 +1,22 @@
|
|||
Version 2.0.0 (in progress)
|
||||
============================
|
||||
|
||||
2010-05-23: wsfulton
|
||||
[C#] Fix #2957375 - SWIGStringHelper and SWIGExceptionHelper not always being
|
||||
initialized before use in .NET 4 as the classes were not marked beforefieldinit.
|
||||
A static constructor has been added to the intermediary class like this:
|
||||
|
||||
%pragma(csharp) imclasscode=%{
|
||||
static $imclassname() {
|
||||
}
|
||||
%}
|
||||
|
||||
If you had added your own custom static constructor to the intermediary class in
|
||||
the same way as above, you will have to modify your approach to use static variable
|
||||
initialization or define SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR - See csharphead.swg.
|
||||
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2010-05-23: wsfulton
|
||||
Fix #2408232. Improve shared_ptr and intrusive_ptr wrappers for classes in an
|
||||
inheritance hierarchy. No special treatment is needed for derived classes.
|
||||
|
|
|
|||
|
|
@ -319,6 +319,14 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_$module(SWIG_CSharpString
|
|||
%}
|
||||
#endif // SWIG_CSHARP_NO_STRING_HELPER
|
||||
|
||||
#if !defined(SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR)
|
||||
// Ensure the class is not marked beforefieldinit
|
||||
%pragma(csharp) imclasscode=%{
|
||||
static $imclassname() {
|
||||
}
|
||||
%}
|
||||
#endif
|
||||
|
||||
%insert(runtime) %{
|
||||
/* Contract support */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue