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

TheCycoONE commented Oct 30, 2014

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

This comment has been minimized.

Copy link
Member Author

TheCycoONE commented Nov 11, 2014

@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

This comment has been minimized.

Copy link
Contributor

Lego3 commented Nov 11, 2014

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

@Lego3

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

TheCycoONE commented Nov 14, 2014

@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
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@Lego3

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.