revert emitter copying

This commit is contained in:
Cameron Ross 2018-06-16 02:20:30 -03:00
parent 118fc291e9
commit 9eb6f314ec
No known key found for this signature in database
GPG key ID: 777897D98DC91C54
3 changed files with 5 additions and 3 deletions

View file

@ -243,7 +243,7 @@ struct Dumper
{ {
try try
{ {
auto emitter = Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_); auto emitter = new Emitter(stream_, canonical_, indent_, textWidth_, lineBreak_);
auto serializer = Serializer(emitter, resolver_, encoding_, explicitStart_, auto serializer = Serializer(emitter, resolver_, encoding_, explicitStart_,
explicitEnd_, YAMLVersion_, tags_); explicitEnd_, YAMLVersion_, tags_);
foreach(ref document; documents) foreach(ref document; documents)

View file

@ -95,6 +95,8 @@ public:
@disable bool opEquals(ref Queue); @disable bool opEquals(ref Queue);
@disable int opCmp(ref Queue); @disable int opCmp(ref Queue);
@disable this(this);
~this() @safe nothrow @nogc ~this() @safe nothrow @nogc
{ {
freeStock(); freeStock();

View file

@ -32,7 +32,7 @@ struct Serializer
{ {
private: private:
///Emitter to emit events produced. ///Emitter to emit events produced.
Emitter emitter_; Emitter* emitter_;
///Resolver used to determine which tags are automaticaly resolvable. ///Resolver used to determine which tags are automaticaly resolvable.
Resolver resolver_; Resolver resolver_;
@ -66,7 +66,7 @@ struct Serializer
* YAMLVersion = YAML version string. * YAMLVersion = YAML version string.
* tagDirectives = Tag directives to emit. * 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!"explicitStart" explicitStart,
const Flag!"explicitEnd" explicitEnd, string YAMLVersion, const Flag!"explicitEnd" explicitEnd, string YAMLVersion,
TagDirective[] tagDirectives) @safe TagDirective[] tagDirectives) @safe