picout fix

This commit is contained in:
2022-04-13 22:46:53 +03:00
parent 2ab2614ab4
commit c7e67b309e
3 changed files with 6 additions and 5 deletions

View File

@@ -160,6 +160,7 @@ PICout::PICout(int controls): fo_(true), cc_(false), fc_(false), act_(true), cnb
}
PICout::PICout(bool active): fo_(true), cc_(false), fc_(false), act_(active), cnb_(10), co_(PICoutManipulators::DefaultControls) {
buffer_ = nullptr;
if (act_)
init();
}
@@ -522,6 +523,7 @@ PICout & PICout::newLine() {
PICout & PICout::write(const char * str, int len) {
if (!act_) return *this;
if (buffer_) {
buffer_->append(PIString(str, len));
} else {
@@ -533,6 +535,7 @@ PICout & PICout::write(const char * str, int len) {
PICout & PICout::writePIString(const PIString & s) {
if (!act_) return *this;
if (buffer_) {
buffer_->append(s);
} else {
@@ -555,7 +558,7 @@ void PICout::init() {
}
attr_ = __Private__::dattr;
#endif
buffer_ = 0;
buffer_ = nullptr;
id_ = 0;
if ((co_ & NoLock) != NoLock)
PICout::__mutex__().lock();