use copies of Emitter instead of passing pointers around
This commit is contained in:
parent
5172f8b932
commit
ccaa7749bb
|
@ -243,7 +243,7 @@ struct Dumper
|
|||
{
|
||||
try
|
||||
{
|
||||
auto emitter = new Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_);
|
||||
auto emitter = Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_);
|
||||
auto serializer = Serializer(emitter, resolver_, encoding_, explicitStart_,
|
||||
explicitEnd_, YAMLVersion_, tags_);
|
||||
foreach(ref document; documents)
|
||||
|
|
|
@ -95,8 +95,6 @@ public:
|
|||
@disable bool opEquals(ref Queue);
|
||||
@disable int opCmp(ref Queue);
|
||||
|
||||
@disable this(this);
|
||||
|
||||
~this() @safe nothrow @nogc
|
||||
{
|
||||
freeStock();
|
||||
|
|
|
@ -32,7 +32,7 @@ struct Serializer
|
|||
{
|
||||
private:
|
||||
///Emitter to emit events produced.
|
||||
Emitter* emitter_;
|
||||
Emitter emitter_;
|
||||
///Resolver used to determine which tags are automaticaly resolvable.
|
||||
Resolver resolver_;
|
||||
|
||||
|
@ -66,7 +66,7 @@ struct Serializer
|
|||
* YAMLVersion = YAML version string.
|
||||
* tagDirectives = Tag directives to emit.
|
||||
*/
|
||||
this(Emitter* emitter, Resolver resolver, Encoding encoding,
|
||||
this(Emitter emitter, Resolver resolver, Encoding encoding,
|
||||
const Flag!"explicitStart" explicitStart,
|
||||
const Flag!"explicitEnd" explicitEnd, string YAMLVersion,
|
||||
TagDirective[] tagDirectives) @safe
|
||||
|
|
Loading…
Reference in a new issue