-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion `_attributePool.CurrentAllocs() == _attributePool.Untracked()' failed #555
Comments
This is most likely because of destructor of |
I did try the virtual destructor, it still keeps raising the same assert. then I just call mycall::myfunc(). Also for the record, the XML document is just fine(I've looked at issue #129., At first I though the problem was that, but like I said I get the same assert with just adding one root node. |
Does the same node get added multiple times into the DOM? |
in the original code i have a vector<vector<string>> being added in,
but like i said, i tried it without that, it literally just adds a
root node and then just saves it but i still get the same problem.
…On 5/23/17, Dmitry-Me ***@***.***> wrote:
Does the same node get added multiple times into the DOM?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#555 (comment)
--
Farzad Sadeghi
project mutator-https://github.com/bloodstalker/mutator
|
What's inside
? |
ctor: RootPointer = Doc.NewElement("mutagen:Report");
RootPointer->SetAttribute("xmlns:mutator", "http://www.w3.org/2001/XMLSchema"); dtor: Doc.InsertEndChild(RootPointer); other stuff: virtual void AddNode(void) = 0; in the source: virtual void AddNode(void)
{
XMLElement* MGene = Doc.NewElement("DoomedStrains");
for (auto &iter : DoomedStrains)
{
XMLElement* NodeDoomedStrain = Doc.NewElement("DoomedStrain");
for (auto &iterer : iter)
{
XMLElement* Child = Doc.NewElement("Strain");
Child->SetText(iterer.c_str());
NodeDoomedStrain->InsertEndChild(Child);
}
MGene->InsertEndChild(NodeDoomedStrain);
}
RootPointer->InsertEndChild(MGene);
} |
There's good chance that for some reason you have |
I think the assert gets triggered wrongly on inheritance. I'll explain more with code:
first suppose we have:
in the header:
BaseClass
[
public:
XMLReportBase();
~XMLReportBase();
}
in the source file:
BaseClass
{
XMLReportBase::XMLReportBase()
{
RootPointer = Doc.NewElement("mutagen:Report");
RootPointer->SetAttribute("xmlns:mutator", "http://www.w3.org/2001/XMLSchema");
}
XMLReportBase::~XMLReportBase()
{
Doc.InsertEndChild(RootPointer);
}
void XMLReportBase::CreateReport()
{
Doc.InsertFirstChild(RootPointer);
}
void XMLReportBase::SaveReport(const char* __filename)
{
Doc.InsertEndChild(RootPointer);
}
}
now if:
B : BaseClass
{
/ctor,dtor,implementation of the pure virtual function, .../
}
this will trigger the assert. If I just move everything into B without inheritance then the assert won't get triggered.
Am I doing something wrong or the assert is being raised incorrectly?
BTW, thank you for tinyxml2. it makes life easier. :)
The text was updated successfully, but these errors were encountered: