@@ -41,17 +41,15 @@ void WriterBase::WriteString(const char* buffer) { impl->w_string(buffer); }
4141void WriterBase::WriteStringZ (const char * buffer) { impl->w_stringZ (buffer); }
4242void WriterBase::WriteString (String^ value)
4343{
44- auto context = gcnew marshal_context () ;
45- auto tmpStr = context-> marshal_as <const char *>(value);
44+ marshal_context context;
45+ auto tmpStr = context. marshal_as <const char *>(value);
4646 impl->w_string (tmpStr);
47- delete context;
4847}
4948void WriterBase::WriteStringZ (String^ value)
5049{
51- auto context = gcnew marshal_context () ;
52- auto tmpStr = context-> marshal_as <const char *>(value);
50+ marshal_context context;
51+ auto tmpStr = context. marshal_as <const char *>(value);
5352 impl->w_stringZ (tmpStr);
54- delete context;
5553}
5654void WriterBase::WriteColorF (ColorF value) { impl->w_fcolor ((const Fcolor&)value); }
5755void WriterBase::WriteVector4F (Vector4F value) { impl->w_fvector4 ((const Fvector4&)value); }
@@ -69,10 +67,9 @@ void WriterBase::WriteScaledDirection(Vector3F value) { impl->w_sdir((const Fvec
6967void WriterBase::WriteString (String^ format, ... array<Object^>^ args)
7068{
7169 auto str = String::Format (format, args);
72- auto context = gcnew marshal_context () ;
73- auto tmpStr = context-> marshal_as <const char *>(str);
70+ marshal_context context;
71+ auto tmpStr = context. marshal_as <const char *>(str);
7472 impl->w (tmpStr, xr_strlen (tmpStr));
75- delete context;
7673}
7774void WriterBase::OpenChunk (UInt32 type) { impl->open_chunk (type); }
7875void WriterBase::CloseChunk () { impl->close_chunk (); }
0 commit comments