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

Replace posix strdup with c standard strlen/malloc/memcpy #348

Merged
merged 1 commit into from Dec 28, 2014

Conversation

TheCycoONE
Copy link
Member

On MSVC the strdup implmentation differs from the posix version causing a heap violation error when the resulting string is freed when CorsixTH is run in debug (at least on MSVC 2010)

On MSVC the strdup implmentation differs from the posix version causing a
heap violation error when the resulting string is freed.
@TheCycoONE
Copy link
Member Author

@Lego3 would you mind to look at this and see if it fixes your heap errors. You were saying on irc you couldn't run in debug mode in visual studio with luaJIT. With this patch it works for me.

@Lego3
Copy link
Contributor

Lego3 commented Nov 11, 2014

Sure, I will try it out in a few days.

@Lego3
Copy link
Contributor

Lego3 commented Nov 14, 2014

It still doesn't work for me. Then again I'm not entirely sure I do everything correctly either...

@TheCycoONE
Copy link
Member Author

@Lego3 Do you still get a heap error? If so could you post the stack trace in a new issue?

Lego3 added a commit that referenced this pull request Dec 28, 2014
Replace posix strdup with c standard strlen/malloc/memcpy
@Lego3 Lego3 merged commit 8520b22 into CorsixTH:master Dec 28, 2014
@Lego3
Copy link
Contributor

Lego3 commented Dec 28, 2014

I had a deeper look at this, and I can confirm that your changes solved that particular part of my problem. The reason it still doesn't work for me is that I now get roughly the same error in the call to Mix_LoadWAV_RW in THSoundEffects::setSoundArchive. If I disable sound in cmake it works fine now.

@lewri lewri added bug issue type and removed Type-Game Crash labels Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants