Skip to content
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

Use std strings + use ifstream to parse configuration #9

Merged
merged 10 commits into from
Sep 5, 2021

Conversation

rob5300
Copy link
Contributor

@rob5300 rob5300 commented Sep 5, 2021

This PR changes how the configuration is loaded as well as how the strings loaded are stored and used.
This is because we experienced double free errors which may have been caused from our manual char[]* deletions.
std::string is now used to avoid such errors.

A vector is also used to avoid us needing to know the file line num beforehand.

Example of old crash, note how even the lines reported does not match:

[CLEANER] 7 lines in cleaner.cfg
[CLEANER] Stripping string on     -> L1: "DataTable warning" - length: 17
[CLEANER] Stripping string on     -> L2: "CreateFragmentsFromFile" - length: 23
[CLEANER] Stripping string on     -> L3: "CSoundEmitterSystemBase" - length: 23
[CLEANER] Stripping string on     -> L4: "ENTITY_CHANGE_NONE" - length: 18
[CLEANER] Stripping string on     -> L5: "EmitSound:" - length: 10
[CLEANER] Stripping string on     -> L6: "EntSelectSpawnPoint" - length: 19
[CLEANER] Stripping string on     -> L7: "CMaterial::PrecacheVars: error" - length: 30
[CLEANER] Stripping string on     -> L8: "SOLID_VPHYSICS static prop with no vphysics model!" - length: 50
double free or corruption (out)

@accelerator74 accelerator74 merged commit ed38fbe into accelerator74:master Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants