sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.69k stars 638 forks source link

Freeing allocated string in DebugName setter #854

Closed ab4d closed 7 years ago

ab4d commented 7 years ago

This is a fix for Issue #850.

Because portable .Net does not provide methods to convert string into ANSI encoded byte array (as proposed by OndrejPetrzilka), the solution is to continue using Marshal.StringToHGlobalAnsi and releasing it with #Marshal.FreeHGlobal.