Fixed MemoryLeak in ConsoleWriterBase

Fixed a memoryleak in the ConsoleWriterBase