MSRevive / MasterSwordRebirth

Continuation of Master Sword Classic/Continued.
https://msrebirth.net/
Other
9 stars 6 forks source link

COM_LoadFile not enough space for maps #200

Open SaintWish opened 1 year ago

SaintWish commented 1 year ago

This exception seems to happen after a server changes levels a few time, seems to mostly affect unstable branch. It might be due to a memory not being cleared for some reason somewhere, but hard to know where since that's all that error gives.

It seems to have happened somewhere around this commit https://github.com/MSRevive/MasterSwordRebirth/commit/7bfdd9082f2ddb40668b66d1c948156f18a47587 which doesn't make sense, since that only affected the client...

thesupersoup commented 1 year ago

I see a few concerning things about string handling at a glance, but I don't see where the vector is properly cleared (calling .clear() is insufficient, line 249 in MSCLGlobals::RemoveAllEntities())

We may want to consider changing the m_Strings.clear() call to std::vector<std::string>().swap(m_Strings) for proper reallocation

SaintWish commented 1 year ago

That's a good idea, I was also planning on replacing the code custom mslist and msstring with standard variant to also help with the memory issue.

SaintWish commented 1 year ago

This is the issue for what I was talking about above https://github.com/MSRevive/MasterSwordRebirth/issues/179 also started doing it in a separate branch just ran out of time to finish it.

thesupersoup commented 1 year ago

I'm very much for using standard types and structures, but I also know that it sometimes isn't so easy even when it should be. I'll be prepared to help with that transition once it's time.