Skip to content

Commit 7770284

Browse files
committed
Fix dirty handling
1 parent 3f5d513 commit 7770284

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/RecordComponent.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,13 @@ RecordComponent &RecordComponent::resetDataset(Dataset d)
251251
}
252252
else if (d.dtype != Datatype::UNDEFINED)
253253
{
254+
setDirty(true);
254255
return makeEmpty(std::move(d));
255256
}
256257
else
257258
{
258259
rc.m_dataset = std::move(d);
260+
setDirty(true);
259261
return *this;
260262
}
261263
}

src/backend/BaseRecord.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,16 @@ inline void BaseRecord<T_elem>::flush(
776776
}
777777

778778
if (!this->written() && this->empty() && !this->datasetDefined())
779+
{
779780
// Verify upon ScientificDefaults::finalize() that the Record has been
780781
// populated. For now, we will assume that data will come later; ignore
781782
// this Record at the moment.
783+
//
784+
// If any of the properties above will change, the Record will become
785+
// dirty through it.
786+
this->setDirty(false);
782787
return;
783-
788+
}
784789
/*
785790
* Defensive programming. Normally, this error should yield as soon as
786791
* possible.

src/backend/BaseRecordComponent.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ BaseRecordComponent &BaseRecordComponent::resetDatatype(Datatype d)
4646
{
4747
rc.m_dataset = Dataset{d, {1}};
4848
}
49+
setDirty(true);
4950
return *this;
5051
}
5152

0 commit comments

Comments
 (0)